1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

[AC-1529] Update settings tab visibility to include device approvals (#5855)

* fix: update show org settings function, add explicit canManageDeviceApprovals helper, refs AC-1529

* fix: add device approval in org-redirect guard and update passed permission, refs AC-1529
This commit is contained in:
Vincent Salucci 2023-08-04 09:18:48 -05:00 committed by GitHub
parent 7f4741f464
commit 15597fb4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 3 deletions

View File

@ -70,6 +70,9 @@ function getSettingsRoute(organization: Organization) {
if (organization.canManageScim) {
return "scim";
}
if (organization.canManageDeviceApprovals) {
return "device-approvals";
}
return undefined;
}

View File

@ -65,7 +65,7 @@
routerLink="device-approvals"
class="list-group-item"
routerLinkActive="active"
*ngIf="org.canManageUsersPassword"
*ngIf="org.canManageDeviceApprovals"
>
{{ "deviceApprovals" | i18n }}
</a>

View File

@ -62,7 +62,7 @@ const routes: Routes = [
canAccessFeature(FeatureFlag.TrustedDeviceEncryption),
],
data: {
organizationPermissions: (org: Organization) => org.canManageUsersPassword,
organizationPermissions: (org: Organization) => org.canManageDeviceApprovals,
titleId: "deviceApprovals",
},
},

View File

@ -15,7 +15,8 @@ export function canAccessSettingsTab(org: Organization): boolean {
org.canManagePolicies ||
org.canManageSso ||
org.canManageScim ||
org.canAccessImportExport
org.canAccessImportExport ||
org.canManageDeviceApprovals
);
}

View File

@ -217,6 +217,10 @@ export class Organization {
return this.isAdmin || this.permissions.manageResetPassword;
}
get canManageDeviceApprovals() {
return (this.isAdmin || this.permissions.manageResetPassword) && this.useSso;
}
get isExemptFromPolicies() {
return this.canManagePolicies;
}