#
View Source Ash.Authorizer behaviour (ash v2.4.22)

The interface for an ash authorizer

These will typically be implemented by an extension, but a custom one can be implemented by defining an extension that also adopts this behaviour.

Then you can extend a resource with `authorizers: [YourAuthorizer]`

# Link to this section Summary

## Types

context()
state()

## Callbacks

check(state, context)
check_context(state)
exception(atom, state)
initial_state( t, record, action, boolean )
strict_check(state, context)
strict_check_context(state)

## Functions

check(module, state, context)
check_context(module, state)
exception(module, reason, state)
initial_state(module, actor, resource, action, verbose?)
strict_check(module, state, context)
strict_check_context(module, state)

# Link to this section Types

Link to this type

# context()

View Source

    @type context() :: map()

Link to this type

# state()

View Source

    @type state() :: map()

# Link to this section Callbacks

Link to this callback

# check(state, context)

View Source

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

Link to this callback

# check_context(state)

View Source

    @callback check_context(state()) :: [atom()]

Link to this callback

# exception(atom, state)

View Source (optional)

    @callback exception(atom(), state()) :: no_return()

Link to this callback

# initial_state( t, record, action, boolean )

View Source

    @callback initial_state(
      Ash.Resource.t(),
      Ash.Resource.record(),
      Ash.Resource.Actions.action(),
      boolean()
    ) :: state()

Link to this callback

# strict_check(state, context)

View Source

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

Link to this callback

# strict_check_context(state)

View Source

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

# 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

# exception(module, reason, 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