#
View Source Ash (ash v2.6.31)

General purpose tools for working with Ash.

Currently only contains setters/getters for process context.

# Link to this section Summary

## Functions

get_actor()

Gets the current actor from the process dictionary

get_authorize?()

Gets the current authorize? from the process dictionary

get_context()

Gets the current context from the process dictionary

get_context_for_transfer(opts \\ [])

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

get_tenant()

Gets the current tenant from the process dictionary

get_tracer()

Gets the current tracer

merge_context(map)

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

set_actor(map)

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

set_authorize?(map)

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

set_context(map)

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

set_tenant(tenant)

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

set_tracer(module)

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

transfer_context(map, opts \\ [])
update_context(fun)

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

# Link to this section Functions

Link to this function

# get_actor()

View Source

    @spec get_actor() :: term()

Gets the current actor from the process dictionary

Link to this function

# get_authorize?()

View Source

    @spec get_authorize?() :: term()

Gets the current authorize? from the process dictionary

Link to this function

# get_context()

View Source

    @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.

Link to this function

# get_tenant()

View Source

    @spec get_tenant() :: term()

Gets the current tenant from the process dictionary

Link to this function

# get_tracer()

View Source

    @spec get_tracer() :: term()

Gets the current tracer

Link to this function

# merge_context(map)

View Source

    @spec merge_context(map()) :: :ok

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

Link to this function

# set_actor(map)

View Source

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

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

Link to this function

# set_authorize?(map)

View Source

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

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

Link to this function

# set_context(map)

View Source

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

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

In Ash 3.0, this will be updated to deep merge

Link to this function

# set_tenant(tenant)

View Source

    @spec set_tenant(String.t()) :: :ok

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

Link to this function

# set_tracer(module)

View Source

    @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

Link to this function

# update_context(fun)

View Source

    @spec update_context((map() -> map())) :: :ok

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