Moving authorization to utils

This commit is contained in:
Matthew Dillon 2015-07-04 11:34:31 -07:00
parent 1c47941413
commit cdc825cc6a
7 changed files with 38 additions and 13 deletions

View file

@ -1,8 +1,9 @@
import Ember from 'ember';
import userCanAdd from '../../../utils/user-can-add';
export default Ember.Component.extend({
canAdd: function() {
let role = this.get('session.currentUser.role');
return (role === 'W') || (role === 'A');
}.property('session.currentUser.role')
let user_role = this.get('session.currentUser.role');
return userCanAdd(user_role);
}.property('session.currentUser.role').readOnly(),
});