Skip to content

Commit 873f3fe

Browse files
committed
restore accidentally removed block
1 parent 72e7c74 commit 873f3fe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

services/galley/src/Galley/API/Teams/Features.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,18 @@ instance SetFeatureConfig db LegalholdConfig where
736736

737737
-- we're good to update the status now.
738738
setConfigForTeam tid wsnl _ = do
739+
-- this extra do is to encapsulate the assertions running before the actual operation.
740+
-- enabling LH for teams is only allowed in normal operation; disabled-permanently and
741+
-- whitelist-teams have no or their own way to do that, resp.
742+
featureLegalHold <- getLegalHoldFlag
743+
case featureLegalHold of
744+
FeatureLegalHoldDisabledByDefault -> do
745+
pure ()
746+
FeatureLegalHoldDisabledPermanently -> do
747+
throw LegalHoldFeatureFlagNotEnabled
748+
FeatureLegalHoldWhitelistTeamsAndImplicitConsent -> do
749+
throw LegalHoldWhitelistedOnly
750+
739751
case wssStatus wsnl of
740752
FeatureStatusDisabled -> LegalHold.removeSettings' @InternalPaging tid
741753
FeatureStatusEnabled -> ensureNotTooLargeToActivateLegalHold tid

0 commit comments

Comments
 (0)