mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-31 17:57:43 +01:00
Move policy checks within policyService (#2036)
* Refactor: use policyService.policyAppliesToUser * Fix inverted condition * Update jslib
This commit is contained in:
parent
1c7504a691
commit
515c72abb0
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit daa4f6f9a6dc84d6cd9a937be6b5392d2cf51eca
|
Subproject commit 30419a625fbdeefee1b0d0c24ee1d26064b17ba2
|
@ -456,18 +456,6 @@ export default class RuntimeBackground {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async allowPersonalOwnership(): Promise<boolean> {
|
private async allowPersonalOwnership(): Promise<boolean> {
|
||||||
const personalOwnershipPolicies = await this.policyService.getAll(PolicyType.PersonalOwnership);
|
return !await this.policyService.policyAppliesToUser(PolicyType.PersonalOwnership);
|
||||||
if (personalOwnershipPolicies != null) {
|
|
||||||
for (const policy of personalOwnershipPolicies) {
|
|
||||||
if (policy.enabled) {
|
|
||||||
const org = await this.userService.getOrganization(policy.organizationId);
|
|
||||||
if (org != null && org.enabled && org.usePolicies && !org.canManagePolicies
|
|
||||||
&& org.status === OrganizationUserStatusType.Confirmed) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user