mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[PM-21883] Add back RemoveUnlockWithPin exemption (#15223)
This commit is contained in:
@@ -490,6 +490,26 @@ describe("PolicyService", () => {
|
|||||||
expect(result).toBe(true);
|
expect(result).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.each([
|
||||||
|
PolicyType.PasswordGenerator,
|
||||||
|
PolicyType.FreeFamiliesSponsorshipPolicy,
|
||||||
|
PolicyType.RestrictedItemTypes,
|
||||||
|
PolicyType.RemoveUnlockWithPin,
|
||||||
|
])("returns true and owners are not exempt from policy %s", async (policyType) => {
|
||||||
|
singleUserState.nextState(
|
||||||
|
arrayToRecord([
|
||||||
|
policyData("policy1", "org2", PolicyType.PasswordGenerator, true),
|
||||||
|
policyData("policy2", "org2", PolicyType.FreeFamiliesSponsorshipPolicy, true),
|
||||||
|
policyData("policy3", "org2", PolicyType.RestrictedItemTypes, true),
|
||||||
|
policyData("policy4", "org2", PolicyType.RemoveUnlockWithPin, true),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
|
||||||
|
const result = await firstValueFrom(policyService.policyAppliesToUser$(policyType, userId));
|
||||||
|
|
||||||
|
expect(result).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
it("returns false when policyType is disabled", async () => {
|
it("returns false when policyType is disabled", async () => {
|
||||||
singleUserState.nextState(
|
singleUserState.nextState(
|
||||||
arrayToRecord([
|
arrayToRecord([
|
||||||
|
|||||||
@@ -281,6 +281,9 @@ export class DefaultPolicyService implements PolicyService {
|
|||||||
case PolicyType.RestrictedItemTypes:
|
case PolicyType.RestrictedItemTypes:
|
||||||
// restricted item types policy
|
// restricted item types policy
|
||||||
return false;
|
return false;
|
||||||
|
case PolicyType.RemoveUnlockWithPin:
|
||||||
|
// Remove Unlock with PIN policy
|
||||||
|
return false;
|
||||||
case PolicyType.OrganizationDataOwnership:
|
case PolicyType.OrganizationDataOwnership:
|
||||||
// organization data ownership policy applies to everyone except admins and owners
|
// organization data ownership policy applies to everyone except admins and owners
|
||||||
return organization.isAdmin;
|
return organization.isAdmin;
|
||||||
|
|||||||
Reference in New Issue
Block a user