feat: 🎸 implement add- and remove-principals abilities
This commit is contained in:
6 files changed
+82
-17
No files matched your search
@@ -14,4 +14,26 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
model.authorized_actions = [];
|
||||
assert.notOk(service.can('setGrants role', model));
|
||||
});
|
||||
|
||||
test('it reflects when a given account may add principals based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['add-principals'],
|
||||
};
|
||||
assert.ok(service.can('addPrincipals role', model));
|
||||
model.authorized_actions = [];
|
||||
assert.notOk(service.can('addPrincipals role', model));
|
||||
});
|
||||
|
||||
test('it reflects when a given account may remove principals based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['remove-principals'],
|
||||
};
|
||||
assert.ok(service.can('removePrincipals role', model));
|
||||
model.authorized_actions = [];
|
||||
assert.notOk(service.can('removePrincipals role', model));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user