What Mediate.Rbac needs beyond the configuration: the policy module
and the mediated repo its rules read through. bind/1 validates the pair
and keeps it for the life of the VM, as Mediate.Config.boot!/1 keeps
the configuration. override/1 puts a binding in the current process for
the rest of its life. resolve/0 reads it from the caller and from its
$callers chain. So a test binds its own policy and repo and leaves the
boot binding alone.
Summary
Functions
Validates once at boot and keeps the binding for resolve/0.
bind/1, but raises the error.
Validates the pair into the struct.
The schema of the binding's options.
Overrides the binding's fields for the rest of the current process.
Overrides the binding's fields around a function. Puts the previous override back after it.
The boot binding under the current process's overrides, or an error when neither exists.
The binding as the keyword list new/1 accepts.
Types
Functions
@spec bind(keyword()) :: {:ok, t()} | {:error, Mediate.Error.t()}
Validates once at boot and keeps the binding for resolve/0.
bind/1, but raises the error.
@spec new(keyword()) :: {:ok, t()} | {:error, Mediate.Error.t()}
Validates the pair into the struct.
@spec options_schema() :: NimbleOptions.t()
The schema of the binding's options.
@spec override(keyword()) :: :ok
Overrides the binding's fields for the rest of the current process.
Overrides the binding's fields around a function. Puts the previous override back after it.
@spec resolve() :: {:ok, t()} | {:error, Mediate.Error.t()}
The boot binding under the current process's overrides, or an error when neither exists.
The binding as the keyword list new/1 accepts.