View Source Ash (ash v2.4.18)

General purpose tools for working with Ash.

Currently only contains setters/getters for process context.

Link to this section Summary

Functions

Gets the current actor from the process dictionary

Gets the current authorize? from the process dictionary

Gets the current context from the process dictionary

Gets all of the ash context so it can be set into a new process.

Gets the current tenant from the process dictionary

Gets the current tracer

Sets actor into the process dictionary that is used for all changesets and queries.

Sets authorize? into the process dictionary that is used for all changesets and queries.

Sets context into the process dictionary that is used for all changesets and queries.

Sets tenant into the process dictionary that is used for all changesets and queries.

Sets the tracer into the process dictionary that will be used to trace requests

Link to this section Functions

@spec get_actor() :: term()

Gets the current actor from the process dictionary

@spec get_authorize?() :: term()

Gets the current authorize? from the process dictionary

@spec get_context() :: term()

Gets the current context from the process dictionary

Link to this function

get_context_for_transfer(opts \\ [])

View Source
@spec get_context_for_transfer(opts :: Keyword.t()) :: term()

Gets all of the ash context so it can be set into a new process.

Use transfer_context/1 in the new process to set the context.

@spec get_tenant() :: term()

Gets the current tenant from the process dictionary

@spec get_tracer() :: term()

Gets the current tracer

@spec set_actor(map()) :: :ok

Sets actor into the process dictionary that is used for all changesets and queries.

@spec set_authorize?(map()) :: :ok

Sets authorize? into the process dictionary that is used for all changesets and queries.

@spec set_context(map()) :: :ok

Sets context into the process dictionary that is used for all changesets and queries.

@spec set_tenant(map()) :: :ok

Sets tenant into the process dictionary that is used for all changesets and queries.

@spec set_tracer(module()) :: :ok

Sets the tracer into the process dictionary that will be used to trace requests

Link to this function

transfer_context(map, opts \\ [])

View Source
@spec transfer_context(term(), opts :: Keyword.t()) :: :ok