Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- getFeatureMulti :: forall cfg r. (GetFeatureConfig cfg, ComputeFeatureConstraints cfg r, Member (Input Opts) r, Member TeamFeatureStore r) => TeamFeatureNoConfigMultiRequest -> Sem r (TeamFeatureNoConfigMultiResponse cfg)
- setFeature :: forall cfg r. (SetFeatureConfig cfg, ComputeFeatureConstraints cfg r, SetFeatureForTeamConstraints cfg r, Member (ErrorS 'NotATeamMember) r, Member (ErrorS OperationDenied) r, Member (Error TeamFeatureError) r, Member (Input Opts) r, Member TeamStore r, Member TeamFeatureStore r, Member TinyLog r, Member NotificationSubsystem r) => UserId -> TeamId -> Feature cfg -> Sem r (LockableFeature cfg)
- setFeatureInternal :: forall cfg r. (SetFeatureConfig cfg, ComputeFeatureConstraints cfg r, SetFeatureForTeamConstraints cfg r, Member (ErrorS 'TeamNotFound) r, Member (Error TeamFeatureError) r, Member (Input Opts) r, Member TeamStore r, Member TeamFeatureStore r, Member TinyLog r, Member NotificationSubsystem r) => TeamId -> Feature cfg -> Sem r (LockableFeature cfg)
- patchFeatureInternal :: forall cfg r. (SetFeatureConfig cfg, ComputeFeatureConstraints cfg r, SetFeatureForTeamConstraints cfg r, Member (ErrorS 'TeamNotFound) r, Member (Input Opts) r, Member TeamStore r, Member TeamFeatureStore r, Member TinyLog r, Member NotificationSubsystem r) => TeamId -> LockableFeaturePatch cfg -> Sem r (LockableFeature cfg)
- getAllTeamFeaturesForTeam :: forall r. (Member (Input Opts) r, Member (ErrorS 'NotATeamMember) r, Member LegalHoldStore r, Member TeamFeatureStore r, Member TeamStore r) => Local UserId -> TeamId -> Sem r AllTeamFeatures
- getAllTeamFeaturesForUser :: forall r. (Member BrigAccess r, Member (ErrorS 'NotATeamMember) r, Member (ErrorS 'TeamNotFound) r, Member (ErrorS OperationDenied) r, Member (Input Opts) r, Member LegalHoldStore r, Member TeamFeatureStore r, Member TeamStore r) => UserId -> Sem r AllTeamFeatures
- updateLockStatus :: forall cfg r. (IsFeatureConfig cfg, Member TeamFeatureStore r, Member TeamStore r, Member (ErrorS 'TeamNotFound) r) => TeamId -> LockStatus -> Sem r LockStatusResponse
- class (IsFeatureConfig cfg, GetFeatureDefaults (FeatureDefaults cfg), NpProject cfg Features) => GetFeatureConfig cfg where
- type GetFeatureForUserConstraints cfg (r :: EffectRow) :: Constraint
- type ComputeFeatureConstraints cfg (r :: EffectRow) :: Constraint
- getFeatureForUser :: GetFeatureForUserConstraints cfg r => UserId -> Sem r (LockableFeature cfg)
- computeFeature :: ComputeFeatureConstraints cfg r => TeamId -> LockableFeature cfg -> DbFeature cfg -> Sem r (LockableFeature cfg)
- class GetFeatureConfig cfg => SetFeatureConfig cfg where
- type SetFeatureForTeamConstraints cfg (r :: EffectRow) :: Constraint
- prepareFeature :: SetFeatureForTeamConstraints cfg r => TeamId -> LockableFeature cfg -> Sem r (LockableFeature cfg)
- guardSecondFactorDisabled :: forall r. (Member TeamFeatureStore r, Member (Input Opts) r, Member (ErrorS 'AccessDenied) r, Member TeamStore r, Member ConversationStore r) => UserId -> ConvId -> Sem r ()
- featureEnabledForTeam :: forall cfg r. (GetFeatureConfig cfg, Member (Input Opts) r, Member (ErrorS 'TeamNotFound) r, Member TeamStore r, Member TeamFeatureStore r, ComputeFeatureConstraints cfg r) => TeamId -> Sem r Bool
- guardMlsE2EIdConfig :: forall r a. Member (Error TeamFeatureError) r => (UserId -> TeamId -> Feature MlsE2EIdConfig -> Sem r a) -> UserId -> TeamId -> Feature MlsE2EIdConfig -> Sem r a
- initialiseTeamFeatures :: (Member (Input Opts) r, Member TeamFeatureStore r) => TeamId -> Sem r ()
Documentation
getFeatureMulti :: forall cfg r. (GetFeatureConfig cfg, ComputeFeatureConstraints cfg r, Member (Input Opts) r, Member TeamFeatureStore r) => TeamFeatureNoConfigMultiRequest -> Sem r (TeamFeatureNoConfigMultiResponse cfg) Source #
setFeature :: forall cfg r. (SetFeatureConfig cfg, ComputeFeatureConstraints cfg r, SetFeatureForTeamConstraints cfg r, Member (ErrorS 'NotATeamMember) r, Member (ErrorS OperationDenied) r, Member (Error TeamFeatureError) r, Member (Input Opts) r, Member TeamStore r, Member TeamFeatureStore r, Member TinyLog r, Member NotificationSubsystem r) => UserId -> TeamId -> Feature cfg -> Sem r (LockableFeature cfg) Source #
setFeatureInternal :: forall cfg r. (SetFeatureConfig cfg, ComputeFeatureConstraints cfg r, SetFeatureForTeamConstraints cfg r, Member (ErrorS 'TeamNotFound) r, Member (Error TeamFeatureError) r, Member (Input Opts) r, Member TeamStore r, Member TeamFeatureStore r, Member TinyLog r, Member NotificationSubsystem r) => TeamId -> Feature cfg -> Sem r (LockableFeature cfg) Source #
patchFeatureInternal :: forall cfg r. (SetFeatureConfig cfg, ComputeFeatureConstraints cfg r, SetFeatureForTeamConstraints cfg r, Member (ErrorS 'TeamNotFound) r, Member (Input Opts) r, Member TeamStore r, Member TeamFeatureStore r, Member TinyLog r, Member NotificationSubsystem r) => TeamId -> LockableFeaturePatch cfg -> Sem r (LockableFeature cfg) Source #
getAllTeamFeaturesForTeam :: forall r. (Member (Input Opts) r, Member (ErrorS 'NotATeamMember) r, Member LegalHoldStore r, Member TeamFeatureStore r, Member TeamStore r) => Local UserId -> TeamId -> Sem r AllTeamFeatures Source #
getAllTeamFeaturesForUser :: forall r. (Member BrigAccess r, Member (ErrorS 'NotATeamMember) r, Member (ErrorS 'TeamNotFound) r, Member (ErrorS OperationDenied) r, Member (Input Opts) r, Member LegalHoldStore r, Member TeamFeatureStore r, Member TeamStore r) => UserId -> Sem r AllTeamFeatures Source #
updateLockStatus :: forall cfg r. (IsFeatureConfig cfg, Member TeamFeatureStore r, Member TeamStore r, Member (ErrorS 'TeamNotFound) r) => TeamId -> LockStatus -> Sem r LockStatusResponse Source #
class (IsFeatureConfig cfg, GetFeatureDefaults (FeatureDefaults cfg), NpProject cfg Features) => GetFeatureConfig cfg where Source #
Don't export methods of this typeclass
Nothing
type GetFeatureForUserConstraints cfg (r :: EffectRow) :: Constraint Source #
type GetFeatureForUserConstraints cfg (r :: EffectRow) = DefaultGetFeatureForUserConstraints cfg r
type ComputeFeatureConstraints cfg (r :: EffectRow) :: Constraint Source #
type ComputeFeatureConstraints cfg r = ()
getFeatureForUser :: GetFeatureForUserConstraints cfg r => UserId -> Sem r (LockableFeature cfg) Source #
default getFeatureForUser :: DefaultGetFeatureForUserConstraints cfg r => UserId -> Sem r (LockableFeature cfg) Source #
computeFeature :: ComputeFeatureConstraints cfg r => TeamId -> LockableFeature cfg -> DbFeature cfg -> Sem r (LockableFeature cfg) Source #
default computeFeature :: TeamId -> LockableFeature cfg -> DbFeature cfg -> Sem r (LockableFeature cfg) Source #
Instances
class GetFeatureConfig cfg => SetFeatureConfig cfg where Source #
Don't export methods of this typeclass
Nothing
type SetFeatureForTeamConstraints cfg (r :: EffectRow) :: Constraint Source #
type SetFeatureForTeamConstraints cfg (r :: EffectRow) = ()
prepareFeature :: SetFeatureForTeamConstraints cfg r => TeamId -> LockableFeature cfg -> Sem r (LockableFeature cfg) Source #
This method takes a feature about to be set, performs the required checks, makes any related updates via the internal API, then finally returns the feature to be persisted and pushed to clients.
The default simply returns the original feature unchanged, which should be enough for most features.
default prepareFeature :: TeamId -> LockableFeature cfg -> Sem r (LockableFeature cfg) Source #
Instances
guardSecondFactorDisabled :: forall r. (Member TeamFeatureStore r, Member (Input Opts) r, Member (ErrorS 'AccessDenied) r, Member TeamStore r, Member ConversationStore r) => UserId -> ConvId -> Sem r () Source #
If second factor auth is enabled, make sure that end-points that don't support it, but should, are blocked completely. (This is a workaround until we have 2FA for those end-points as well.)
This function exists to resolve a cyclic dependency.
featureEnabledForTeam :: forall cfg r. (GetFeatureConfig cfg, Member (Input Opts) r, Member (ErrorS 'TeamNotFound) r, Member TeamStore r, Member TeamFeatureStore r, ComputeFeatureConstraints cfg r) => TeamId -> Sem r Bool Source #
guardMlsE2EIdConfig :: forall r a. Member (Error TeamFeatureError) r => (UserId -> TeamId -> Feature MlsE2EIdConfig -> Sem r a) -> UserId -> TeamId -> Feature MlsE2EIdConfig -> Sem r a Source #
initialiseTeamFeatures :: (Member (Input Opts) r, Member TeamFeatureStore r) => TeamId -> Sem r () Source #