AbsinthePermission.Load (AbsinthePermission v1.0.0)

Copy Markdown View Source

Declares a piece of data to fetch before a rule is evaluated.

Loads are resolved once per request before any pre-op rule runs. Each rule references the loaded record by name via loaded(:name) in its condition.

Fields

  • :name — atom; how the loaded record is referenced in conditions
  • :loader — atom; key in the schema's loaders block
  • :by — condition expression that evaluates to the lookup key (e.g. {:arg, :id})
  • :remote_key — atom; field on the loaded record to match against, or nil if the loader takes the key directly

Summary

Types

t()

@type t() :: %AbsinthePermission.Load{
  by: AbsinthePermission.Condition.expr(),
  loader: atom(),
  name: atom(),
  remote_key: atom() | nil
}