Refactor account and user abilities (#1694)
* refactor: 💡 add abilities to user and remove from account
This commit is contained in:
1 parent
fe81a626fa
commit
379f317d8b
5 files changed
+269
-102
No files matched your search
@@ -24,4 +24,20 @@ export default class UserAbility extends ModelAbility {
|
||||
get canRemoveAccounts() {
|
||||
return this.hasAuthorizedAction('remove-accounts');
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canAddAccount() {
|
||||
const { account, canAddAccounts } = this;
|
||||
return canAddAccounts && !account.isUnknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canRemoveAccount() {
|
||||
const { account, canRemoveAccounts } = this;
|
||||
return canRemoveAccounts && !account.isUnknown;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user