Ash.Authorizer behaviour (ash v1.46.8) View Source

The interface for an ash authorizer

These will typically be implemented by an extension, but a custom one can be implemented by defining a module that adopts this behaviour and using @authorizers YourAuthorizer to your resource.

Link to this section Summary

Link to this section Types

Specs

context() :: map()

Specs

state() :: map()

Link to this section Functions

Link to this function

check(module, state, context)

View Source
Link to this function

check_context(module, state)

View Source
Link to this function

initial_state(module, actor, resource, action, verbose?)

View Source
Link to this function

strict_check(module, state, context)

View Source
Link to this function

strict_check_context(module, state)

View Source

Link to this section Callbacks

Specs

check(state(), context()) ::
  :authorized | {:data, [Ash.Resource.record()]} | {:error, term()}

Specs

check_context(state()) :: [atom()]
Link to this callback

initial_state(arg1, arg2, arg3, boolean)

View Source

Specs

Link to this callback

strict_check(state, context)

View Source

Specs

strict_check(state(), context()) ::
  :authorized
  | {:continue, state()}
  | {:filter, Keyword.t()}
  | {:filter_and_continue, Keyword.t(), state()}
  | {:error, term()}
Link to this callback

strict_check_context(state)

View Source

Specs

strict_check_context(state()) :: [atom()]