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:
1 parent
e8a10b3131
commit
6dd0423923
14 files changed
+551
-51
No files matched your search
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user