refactor: 💡 account and auth-method abilities (#1691)

* refactor: 💡 account and auth-method abilities

* refactor: 💡 add update & delete abilities & unit tests
This commit is contained in:
lisbet-alvarez authored and GitHub committed 2023-05-17 14:31:12 -07:00
1 parent e8a10b3131
commit 6dd0423923
14 files changed
+551 -51

No files matched your search

+14
View File
@@ -17,4 +17,18 @@ export default class AuthMethodAbility extends ModelAbility {
get canRead() {
return !this.model.isUnknown && this.hasAuthorizedAction('read');
}
/**
* Only "known" auth method types may be updated.
*/
get canUpdate() {
return !this.model.isUnknown && this.hasAuthorizedAction('update');
}
/**
* Only "known" auth method types may be deleted.
*/
get canDelete() {
return !this.model.isUnknown && this.hasAuthorizedAction('delete');
}
}