Edit species

This commit is contained in:
Matthew Dillon 2015-07-07 14:28:16 -08:00
parent 583d7ca0db
commit 3436989a89
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,14 @@
import Ember from 'ember';
export default Ember.Controller.extend({
userCanEdit: function() {
let meta = this.store.metadataFor('species');
let id = this.get('model.id');
if (meta.canEdit.indexOf( +id ) === -1) {
return false
}
return true;
}.property('model.isLoaded').readOnly(),
});

View file

@ -55,3 +55,9 @@
</fieldset> </fieldset>
</div> </div>
</div> </div>
{{#if userCanEdit}}
<br>
{{#link-to 'species.edit' model class="button-gray smaller"}}
Edit
{{/link-to}}
{{/if}}