cartodb-4.42/lib/assets/javascripts/cartodb/models/group.js

26 lines
668 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
/**
* 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;
}
});