Merge branch 'main' into chore-enhanced-user-info
This commit is contained in:
41 files changed
+731
-166
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import ModelAbility from './model';
|
||||
|
||||
/**
|
||||
* Provides abilities for accounts.
|
||||
*/
|
||||
export default class AccountAbility extends ModelAbility {
|
||||
// =permissions
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canSetPassword() {
|
||||
return this.hasAuthorizedAction('set-password');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import ModelAbility from './model';
|
||||
|
||||
/**
|
||||
* Provides abilities for groups.
|
||||
*/
|
||||
export default class GroupAbility extends ModelAbility {
|
||||
// =permissions
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canAddMembers() {
|
||||
return this.hasAuthorizedAction('add-members');
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canRemoveMembers() {
|
||||
return this.hasAuthorizedAction('remove-members');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import ModelAbility from './model';
|
||||
|
||||
/**
|
||||
* Provides abilities for host sets.
|
||||
*/
|
||||
export default class UserAbility extends ModelAbility {
|
||||
// =permissions
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canAddHosts() {
|
||||
return this.hasAuthorizedAction('add-hosts');
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canRemoveHosts() {
|
||||
return this.hasAuthorizedAction('remove-hosts');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import ModelAbility from './model';
|
||||
|
||||
/**
|
||||
* Provides abilities for roles.
|
||||
*/
|
||||
export default class RoleAbility extends ModelAbility {
|
||||
// =permissions
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canSetGrants() {
|
||||
return this.hasAuthorizedAction('set-grants');
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canAddPrincipals() {
|
||||
return this.hasAuthorizedAction('add-principals');
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canRemovePrincipals() {
|
||||
return this.hasAuthorizedAction('remove-principals');
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import ModelAbility from './model';
|
||||
|
||||
/**
|
||||
* Provides a `connect` ability for targets.
|
||||
* Provides abilities for targets.
|
||||
*/
|
||||
export default class TargetAbility extends ModelAbility {
|
||||
// =permissions
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import ModelAbility from './model';
|
||||
|
||||
/**
|
||||
* Provides abilities for users.
|
||||
*/
|
||||
export default class UserAbility extends ModelAbility {
|
||||
// =permissions
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canAddAccounts() {
|
||||
return this.hasAuthorizedAction('add-accounts');
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canRemoveAccounts() {
|
||||
return this.hasAuthorizedAction('remove-accounts');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user