View Source Ash.Policy.SimpleCheck behaviour (ash v3.0.8)

A type of check that operates only on request context, never on the data

Define match?/3, which gets the actor, request context, and opts, and returns true or false

Summary

Callbacks

Whether or not the request matches the check

Types

@type actor() :: Ash.Policy.Check.actor()
@type context() :: %{
  :action => Ash.Resource.Actions.action(),
  :resource => Ash.Resource.t(),
  :domain => Ash.Domain.t(),
  optional(:query) => Ash.Query.t(),
  optional(:changeset) => Ash.Changeset.t(),
  optional(any()) => any()
}
@type options() :: Keyword.t()

Callbacks

Link to this callback

match?(actor, context, options)

View Source
@callback match?(actor(), context(), options()) ::
  boolean() | {:ok, boolean()} | {:error, term()}

Whether or not the request matches the check