mirror of
https://github.com/bitwarden/browser
synced 2026-01-04 17:43:39 +00:00
[PM-18566] Wire up vNextPolicyService for Clients (#13678)
* wire up vNext impl * wire up vNextPolicyService for browser * wire up vNextPolicyService for desktop * wire up vNextPolicyService for cli * fix test * fix missed caller * cleanup * fix missing property assignment * fix QA bug for PM-19205 * fix QA bug for PM-19206 * fix QA bug for pm-19228 * cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { firstValueFrom } from "rxjs";
|
||||
import { firstValueFrom, switchMap } from "rxjs";
|
||||
|
||||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
||||
@@ -144,10 +144,14 @@ export class EncryptedMessageHandlerService {
|
||||
|
||||
const credentialCreatePayload = payload as CredentialCreatePayload;
|
||||
|
||||
if (
|
||||
credentialCreatePayload.name == null ||
|
||||
(await this.policyService.policyAppliesToUser(PolicyType.PersonalOwnership))
|
||||
) {
|
||||
const policyApplies$ = this.accountService.activeAccount$.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.policyService.policyAppliesToUser$(PolicyType.PersonalOwnership, userId),
|
||||
),
|
||||
);
|
||||
|
||||
if (credentialCreatePayload.name == null || (await firstValueFrom(policyApplies$))) {
|
||||
return { status: "failure" };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user