1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 14 deletions

2
jslib

@ -1 +1 @@
Subproject commit daa4f6f9a6dc84d6cd9a937be6b5392d2cf51eca
Subproject commit 30419a625fbdeefee1b0d0c24ee1d26064b17ba2

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