1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

Move policy checks within policyService (#2036)

* Refactor: use policyService.policyAppliesToUser

* Fix inverted condition

* Update jslib
This commit is contained in:
Thomas Rittson
2021-09-01 07:11:28 +10:00
committed by GitHub
parent 1c7504a691
commit 515c72abb0
2 changed files with 2 additions and 14 deletions

2
jslib

Submodule jslib updated: daa4f6f9a6...30419a625f

View File

@@ -456,18 +456,6 @@ export default class RuntimeBackground {
}
private async allowPersonalOwnership(): Promise<boolean> {
const personalOwnershipPolicies = await this.policyService.getAll(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;
return !await this.policyService.policyAppliesToUser(PolicyType.PersonalOwnership);
}
}