mirror of
https://github.com/bitwarden/jslib
synced 2025-12-28 06:03:14 +00:00
Move access logic to org model (#713)
This commit is contained in:
@@ -181,4 +181,27 @@ export class Organization {
|
||||
get isExemptFromPolicies() {
|
||||
return this.canManagePolicies;
|
||||
}
|
||||
|
||||
get canAccessManageTab(): boolean {
|
||||
return (
|
||||
this.canManageUsers ||
|
||||
this.canViewAllCollections ||
|
||||
this.canViewAssignedCollections ||
|
||||
this.canManageGroups ||
|
||||
this.canManagePolicies ||
|
||||
this.canAccessEventLogs
|
||||
);
|
||||
}
|
||||
|
||||
get canAccessToolsTab(): boolean {
|
||||
return this.canAccessImportExport || this.canAccessReports;
|
||||
}
|
||||
|
||||
get canAccessSettingsTab(): boolean {
|
||||
return this.isOwner;
|
||||
}
|
||||
|
||||
get canAccessAdminView() {
|
||||
return this.canAccessManageTab || this.canAccessToolsTab || this.canAccessSettingsTab;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user