Dropping ember-can
This commit is contained in:
parent
3501dc1986
commit
53be80d617
13 changed files with 57 additions and 75 deletions
|
@ -3,6 +3,14 @@ import Ember from 'ember';
|
|||
export default Ember.Component.extend({
|
||||
classNames: ['grid-1'],
|
||||
isEditing: false,
|
||||
|
||||
canEdit: function() {
|
||||
let role = this.get('session.currentUser.role');
|
||||
let id = this.get('session.currentUser.id');
|
||||
let author = this.get('strain.createdBy');
|
||||
return (role === 'W' && (+id === author)) || (role === 'A');
|
||||
}.property('session.currentUser.role', 'session.currentUser.id', 'strain.createdBy'),
|
||||
|
||||
actions: {
|
||||
save: function() {
|
||||
this.sendAction('save');
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
</div>
|
||||
|
||||
{{! ROW 6 }}
|
||||
{{#if (can "edit strain" strain)}}
|
||||
{{#if canEdit}}
|
||||
<div class="grid-4">
|
||||
<div class="span-1">
|
||||
{{! Does nothing ATM }}
|
||||
|
|
Reference in a new issue