mirror of
https://github.com/bitwarden/web
synced 2026-01-07 19:13:21 +00:00
Move policy checks within policyService (#1149)
* Refactor: use new policyService methods * Update jslib
This commit is contained in:
@@ -268,17 +268,7 @@ export class OrganizationPlansComponent implements OnInit {
|
||||
}
|
||||
|
||||
private async userHasBlockingSingleOrgPolicy() {
|
||||
const policies = await this.policyService.getAll(PolicyType.SingleOrg);
|
||||
const orgs = await this.userService.getAllOrganizations();
|
||||
|
||||
const orgsWithSingleOrgPolicy = policies
|
||||
.filter(p => p.enabled && p.type === PolicyType.SingleOrg)
|
||||
.map(p => p.organizationId);
|
||||
|
||||
return orgs.some(org => org.type !== OrganizationUserType.Owner &&
|
||||
org.type !== OrganizationUserType.Admin &&
|
||||
org.status !== OrganizationUserStatusType.Invited &&
|
||||
orgsWithSingleOrgPolicy.includes(org.id));
|
||||
return this.policyService.policyAppliesToUser(PolicyType.SingleOrg);
|
||||
}
|
||||
|
||||
private async updateOrganization(orgId: string) {
|
||||
|
||||
Reference in New Issue
Block a user