Authorship

This commit is contained in:
Matthew Dillon 2015-05-13 15:29:17 -08:00
parent e2aa298a8f
commit 8afce44a5e
7 changed files with 65 additions and 21 deletions

View file

@ -11,7 +11,7 @@ export default Ability.extend({
canEdit: function() {
let role = this.get('session.currentUser.role');
let id = this.get('session.currentUser.id');
let author = this.get('model.author');
let author = this.get('model.createdBy');
return (role === 'W' && (+id === author)) || (role === 'A');
}.property('session.currentUser.role', 'session.currentUser.id', 'model.author')
}.property('session.currentUser.role', 'session.currentUser.id', 'model.createdBy')
});