graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.RQL.Types.Roles.Internal

Synopsis

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

Constructors

CPUndefined 
CPInconsistent 
CPDefined permissionType 

Instances

Instances details
Eq permissionType => Eq (CheckPermission permissionType) Source # 
Instance details

Defined in Hasura.RQL.Types.Roles.Internal

Methods

(==) :: CheckPermission permissionType -> CheckPermission permissionType -> Bool #

(/=) :: CheckPermission permissionType -> CheckPermission permissionType -> Bool #

Show permissionType => Show (CheckPermission permissionType) Source # 
Instance details

Defined in Hasura.RQL.Types.Roles.Internal

Methods

showsPrec :: Int -> CheckPermission permissionType -> ShowS #

show :: CheckPermission permissionType -> String #

showList :: [CheckPermission permissionType] -> ShowS #

OnlyRelevantEq permissionType => Semigroup (CheckPermission permissionType) Source # 
Instance details

Defined in Hasura.RQL.Types.Roles.Internal

Methods

(<>) :: CheckPermission permissionType -> CheckPermission permissionType -> CheckPermission permissionType #

sconcat :: NonEmpty (CheckPermission permissionType) -> CheckPermission permissionType #

stimes :: Integral b => b -> CheckPermission permissionType -> CheckPermission permissionType #

OnlyRelevantEq permissionType => Monoid (CheckPermission permissionType) Source # 
Instance details

Defined in Hasura.RQL.Types.Roles.Internal

Methods

mempty :: CheckPermission permissionType #

mappend :: CheckPermission permissionType -> CheckPermission permissionType -> CheckPermission permissionType #

mconcat :: [CheckPermission permissionType] -> CheckPermission permissionType #

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.

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:

  1. When comparing two ScalarTypeDefinition, the description of the type doesn't matter.
  2. 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.

Methods

relevantEq :: a -> a -> Bool Source #