View Source Ash.Authorizer behaviour (ash v3.3.0)
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]
Summary
Types
Callbacks
@callback add_calculations(Ash.Query.t() | Ash.Changeset.t(), state(), context()) :: {:ok, Ash.Query.t() | Ash.Changeset.t(), state()} | {:error, Ash.Error.t()}
@callback alter_filter(filter :: Ash.Filter.t(), state(), context()) :: {:ok, Ash.Filter.t()} | {:error, Ash.Error.t()}
@callback alter_results(state(), [Ash.Resource.record()], context()) :: {:ok, [Ash.Resource.record()]} | {:error, Ash.Error.t()}
@callback check(state(), context()) :: :authorized | {:data, [Ash.Resource.record()]} | {:error, term()}
@callback initial_state( Ash.Resource.t(), Ash.Resource.record(), Ash.Resource.Actions.action(), Ash.Domain.t() ) :: state()