26 lines
668 B
JavaScript
26 lines
668 B
JavaScript
|
/**
|
||
|
* Model representing a group.
|
||
|
* Expected to be used in the context of a groups collection (e.g. cdb.admin.OrganizationGroups),
|
||
|
* which defines its API endpoint path.
|
||
|
*/
|
||
|
cdb.admin.Group = cdb.core.Model.extend({
|
||
|
|
||
|
defaults: {
|
||
|
display_name: '' // UI name, as given by
|
||
|
// name: '', // internal alphanumeric representation, converted from display_name internally
|
||
|
// organization_id: '',
|
||
|
},
|
||
|
|
||
|
initialize: function(attrs) {
|
||
|
this.parse(attrs || {}); // handle given attrs in the same way as for .fetch()
|
||
|
},
|
||
|
|
||
|
parse: function(attrs) {
|
||
|
this.users = new cdb.admin.GroupUsers(attrs.users, {
|
||
|
group: this
|
||
|
});
|
||
|
return attrs;
|
||
|
}
|
||
|
|
||
|
});
|