Refactor account and user abilities (#1694)

* refactor: 💡 add abilities to user and remove from account
This commit is contained in:
lisbet-alvarez authored and GitHub committed 2023-05-22 11:16:48 -07:00
1 parent fe81a626fa
commit 379f317d8b
5 files changed
+269 -102

No files matched your search

+16
View File
@@ -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;
}
}