Skip to content

Instantly share code, notes, and snippets.

@kuon
Created January 13, 2011 10:55
Show Gist options
  • Save kuon/777705 to your computer and use it in GitHub Desktop.
Save kuon/777705 to your computer and use it in GitHub Desktop.
SG.groupsUserFilter = SC.Object.create({
allUsersBinding:"SG.usersController.arrangedObjects",
users:function() {
var a = this.get('allUsers');
if(!a) return null;
return a.filter(function(user) {
if(user.get('superAdmin')) return NO;
if(user.get('clientAdmin')) return NO;
if(user.get('contentAdmin')) return YES;
return NO;
});
}.property(),
_allUsersDidChange:function() {
this.propertyDidChange('users');
}.observes('*allUsers.[]')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment