AbsinthePermission.PolicyChecker (AbsinthePermission v0.1.0)
This module provides pre and post operation policy checks functionality.
Link to this section Summary
Functions
Check given permission is in permission list.
If given permission is nil or empty string
it'll evaluate as true.
Filters given data based on filters specified for a policy.
Checks given policies against input arguments and absinthe context. If there is match to any policies, it'll return highest ranked policy's permission. If there is no match to any policy, then there's no need to any permission. So it'll return permission granted.
Link to this section Types
args()
Specs
args() :: Keyword.t()
clause()
Specs
clause() :: Keyword.t()
condition()
Specs
condition() :: Keyword.t()
permission()
Specs
remote_context()
Specs
remote_context() :: Keyword.t()
Link to this section Functions
has_permission?(required_perm, user_perms)
Specs
Check given permission is in permission list.
If given permission is nil or empty string
it'll evaluate as true.
reject(val, fun)
Specs
reject(val, filters, args, context)
Specs
Filters given data based on filters specified for a policy.
should_we_allow?(args, conds, context)
Specs
Checks given policies against input arguments and absinthe context. If there is match to any policies, it'll return highest ranked policy's permission. If there is no match to any policy, then there's no need to any permission. So it'll return permission granted.