Open Gorzas opened 3 years ago
Btw, you can just use the ability class just like before.
import { Ability } from 'ember-can';
export default class AuthUser extends Ability {
get canUserManage() {
return true;
}
}
I've migrated Ability to ES6 class but it still needs more work to be done. Right now, it still depends on EmberObject:
import EmberObject, { get } from '@ember/object';
import { camelize } from '@ember/string';
export default class Ability extends EmberObject {
model = null;
This may be because this line but I decided it's a problem worth to be solved later.
And it's also being tested using computed properties instead of the new tracked syntax.
Just as reminder there are two changes left to finish this issue as talked about in the PR:
The latests versions of EmberJS are deprecating the use of EmberObject and Ember computed properties to use native ones instead. This could be a good improvement, also if we think in making it easier for users of other frameworks to start using EmberJS. An start could be changing the Ability class to use ES6 native classes.
I think this changes should be for a potential new major version (4.0.0 of
ember-can
) as it could remove some compatibilities with older versions of EmberJS. What do you think?