mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
Move policy checks within policyService (#2036)
* Refactor: use policyService.policyAppliesToUser * Fix inverted condition * Update jslib
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: daa4f6f9a6...30419a625f
@@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user