Builds a Parc.Request from an Ash.Policy.Authorizer context wrapped changeset,
query, or action input. This is the request construction half of the AshParc
adapter.
Requests carry the raw Ash shared context untouched, leaving vetting to a pipeline
step. The AshParc.ResetAshContext preparer may be used to uplift policy-trusted
keys and drop the rest, so the decider never sees raw framework context.
Summary
Functions
Builds the Parc.Request for an Ash policy evaluation. Raises ArgumentError when
context carries no recognized subject (changeset, query, or action input).
Functions
@spec build(term(), map(), keyword()) :: Parc.Request.t()
Builds the Parc.Request for an Ash policy evaluation. Raises ArgumentError when
context carries no recognized subject (changeset, query, or action input).
The actor becomes the request principal; the Ash subject maps onto the rest:
request.action.arguments: the action arguments named by the:argumentsoption (a list of names, default none).request.resource.attributes: the instance attributes named by the:attributesoption, read from the record's pre-change values; only on an update or destroy,nilotherwise.request.context.ash_context: the raw Ash shared context.request.context.tenant: the subject's tenant.request.context.<key>: each:contextprojection, an argument or instance attribute lifted under its normalized key (an attribute source resolves only on update/destroy,nilotherwise).