Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CheckPermission permissionType
- = CPUndefined
- | CPInconsistent
- | CPDefined permissionType
- data CombineRolePermInfo (b :: BackendType) = CombineRolePermInfo {}
- rolePermInfoToCombineRolePermInfo :: RolePermInfo b -> CombineRolePermInfo b
- class OnlyRelevantEq a where
- relevantEq :: a -> a -> Bool
- maybeToCheckPermission :: Maybe a -> CheckPermission a
Documentation
data CheckPermission permissionType Source #
CheckPermission
is a type which can be used to combine multiple
permissions when the permission type implements the OnlyRelevantEq
instance
CPUndefined | |
CPInconsistent | |
CPDefined permissionType |
Instances
data CombineRolePermInfo (b :: BackendType) Source #
CombineRolePermInfo acts as an intermediate type to be able to
combine multiple role permissions into one, using the Monoid
instance. Multiple role permissions are combined for inherited
role permissions where this is used.
Instances
(Backend b, Semigroup (CheckPermission (DelPermInfo b)), Semigroup (CheckPermission (InsPermInfo b)), Semigroup (CheckPermission (UpdPermInfo b)), Semigroup (CombinedSelPermInfo b)) => Semigroup (CombineRolePermInfo b) Source # | |
Defined in Hasura.RQL.Types.Roles.Internal (<>) :: CombineRolePermInfo b -> CombineRolePermInfo b -> CombineRolePermInfo b # sconcat :: NonEmpty (CombineRolePermInfo b) -> CombineRolePermInfo b # stimes :: Integral b0 => b0 -> CombineRolePermInfo b -> CombineRolePermInfo b # | |
(Backend b, Monoid (CheckPermission (DelPermInfo b)), Monoid (CheckPermission (InsPermInfo b)), Monoid (CheckPermission (UpdPermInfo b)), Monoid (Maybe (CombinedSelPermInfo b))) => Monoid (CombineRolePermInfo b) Source # | |
Defined in Hasura.RQL.Types.Roles.Internal mempty :: CombineRolePermInfo b # mappend :: CombineRolePermInfo b -> CombineRolePermInfo b -> CombineRolePermInfo b # mconcat :: [CombineRolePermInfo b] -> CombineRolePermInfo b # |
class OnlyRelevantEq a where Source #
OnlyRelevantEq
is a type class to implement checking if
two types have the relevant info of a type equal. This typeclass is almost
like the Eq
typeclass but gives the flexibility of having custom
rules to check the equality of only the relevant data. Some use cases of
it are:
- When comparing two
ScalarTypeDefinition
, the description of the type doesn't matter. - The directives are represented as a list, but the order of the directives don't matter
Note: When there's nothing there to discard in a type, the OnlyRelevantEq
can be derived
as (if needed)
instance OnlyRelevantEq a where relevantEq = (==)
NOTE: Do not export this type class from this module, as it is only intended to be used in the context of inherited roles. If you think this typeclass fits your use case, then please discuss this with Karthikeyan or in Slack thread to make this a generic typeclass.
relevantEq :: a -> a -> Bool Source #
maybeToCheckPermission :: Maybe a -> CheckPermission a Source #