1
0
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:
Thomas Rittson
2022-03-09 12:50:55 +10:00
committed by GitHub
parent 6e345bc4cc
commit 23bdc0b410

View File

@@ -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;
}
}