vendredi 20 janvier 2017

Ember.js - How to get current user properties in abilities source file while using ember-can addon

How to get user object in abilities source file in Ember-can addon. This is how my abilities file looks like.

import Ember from 'ember';
import { Ability } from 'ember-can';

export default Ability.extend({
    canWrite: Ember.computed('user.isAdmin', function() {
       return this.get('user.isAdmin');
    })
});




Aucun commentaire:

Enregistrer un commentaire