package guardian

  1. Overview
  2. Docs
module Actor : sig ... end
module Target : sig ... end
type auth_rule = Actor.spec * Action.t * Target.spec
val equal_auth_rule : auth_rule -> auth_rule -> Ppx_deriving_runtime.bool
val show_auth_rule : auth_rule -> Ppx_deriving_runtime.string
val compare_auth_rule : auth_rule -> auth_rule -> Ppx_deriving_runtime.int
type effect = Action.t * Target.spec

action, target Denotes an effect a function may have on and therefore which permissions an actor needs to invoke it.

val equal_effect : effect -> effect -> Ppx_deriving_runtime.bool
val show_effect : effect -> Ppx_deriving_runtime.string
val compare_effect : effect -> effect -> Ppx_deriving_runtime.int
module Effect_set : sig ... end
val checker_of_rules : ?any_of:bool -> 'a Authorizable.t -> auth_rule list -> (unit, string) CCResult.t

Convenience function to return a can function. Takes an optional target specification (for error reporting purposes) and a list of guardian rules of the form actor, action, target and returns a function that looks like:

any_of: indicates that the checker should pass if any of the rules in the list is satisfied. The default behaviour is to only pass if all rules are. val can : actor:[ whatever ] Guard.Authorizable.t -> (unit, string) result

module Auth_rule_set : sig ... end
module type Actor_module = sig ... end
module type Target_module = sig ... end
OCaml

Innovation. Community. Security.