From a8cd718405fafcf83184a366d4594c8c0c2b6a76 Mon Sep 17 00:00:00 2001 From: Cy Okeke Date: Thu, 7 Nov 2024 12:06:12 +0100 Subject: [PATCH] Add the free family policy behind flag --- bitwarden_license/bit-web/src/app/app.component.ts | 11 +++++++++-- libs/common/src/enums/feature-flag.enum.ts | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bitwarden_license/bit-web/src/app/app.component.ts b/bitwarden_license/bit-web/src/app/app.component.ts index dd814f5c0d..1e0f60e2cd 100644 --- a/bitwarden_license/bit-web/src/app/app.component.ts +++ b/bitwarden_license/bit-web/src/app/app.component.ts @@ -20,10 +20,17 @@ export class AppComponent extends BaseAppComponent implements OnInit { this.policyListService.addPolicies([ new MaximumVaultTimeoutPolicy(), new DisablePersonalVaultExportPolicy(), - new FreeFamiliesSponsorshipPolicy(), - new ActivateAutofillPolicy(), ]); + this.configService + .getFeatureFlag(FeatureFlag.DisableFreeFamiliesSponsorship) + .then((isFreeFamilyEnabled) => { + if (isFreeFamilyEnabled) { + this.policyListService.addPolicies([new FreeFamiliesSponsorshipPolicy()]); + } + this.policyListService.addPolicies([new ActivateAutofillPolicy()]); + }); + this.configService.getFeatureFlag(FeatureFlag.IdpAutoSubmitLogin).then((enabled) => { if ( enabled && diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index 84cf5ed521..c275e403f0 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -36,6 +36,7 @@ export enum FeatureFlag { AccessIntelligence = "pm-13227-access-intelligence", Pm13322AddPolicyDefinitions = "pm-13322-add-policy-definitions", LimitCollectionCreationDeletionSplit = "pm-10863-limit-collection-creation-deletion-split", + DisableFreeFamiliesSponsorship = "PM-12274-disable-free-families-sponsorship", } export type AllowedFeatureFlagTypes = boolean | number | string; @@ -82,6 +83,7 @@ export const DefaultFeatureFlagValue = { [FeatureFlag.AccessIntelligence]: FALSE, [FeatureFlag.Pm13322AddPolicyDefinitions]: FALSE, [FeatureFlag.LimitCollectionCreationDeletionSplit]: FALSE, + [FeatureFlag.DisableFreeFamiliesSponsorship]: FALSE, } satisfies Record; export type DefaultFeatureFlagValueType = typeof DefaultFeatureFlagValue;