Skip to content

Instantly share code, notes, and snippets.

@jberthet
Created February 24, 2014 13:40
Show Gist options
  • Select an option

  • Save jberthet/9188601 to your computer and use it in GitHub Desktop.

Select an option

Save jberthet/9188601 to your computer and use it in GitHub Desktop.
App.EditusersaclController = Ember.Controller.extend({
availableUsers: [],
allowedUsers: [],
updateUsersList: function () {
this.send('updateListForProperty', 'available');
this.send('updateListForProperty', 'allowed');
},
updateListForProperty: function (statutToCheck) {
var that = this;
this.store.filter(
'user',
function (user) {
return user.get('pageAclStatut') === statutToCheck;
}
).then(
function (foundUsers) {
that.set(statutToCheck + 'Users', foundUsers);
}
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment