AshParc.PolicyCheck (ash_parc v0.1.0)

Copy Markdown View Source

Generic Ash.Policy.SimpleCheck behind AshParc.can_perform/2, the enforcement point (PEP) gating a write or generic action. It builds a Parc.Request via AshParc.RequestBuilder (which raises on a context with no recognized subject), runs it through the policy's own run/1, and maps the resulting Parc.PolicyDecider.response/0 to the check outcome: allow passes, deny and challenge fail, an error becomes a check error (see Parc.PolicyDecider).

The allow obligations are ignored here; a strict gate needs only the verdict. Read-row-scoping that consumes obligations is a resource-owned Ash.Policy.FilterCheck (see AshParc.RequestBuilder).

AshParc.can_perform/2 options:

  • :policy: the policy module whose run/1 pipeline this check invokes.
  • :arguments: action arguments to pass into the Parc request.
  • :attributes: instance attributes to pass into the Parc request.
  • :context: arguments/attributes lifted into the request context under a normalized key.

Summary

Functions

eager_evaluate?()

Callback implementation for Ash.Policy.Check.eager_evaluate?/0.

init(opts)

Callback implementation for Ash.Policy.Check.init/1.

prefer_expanded_description?()

Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.

requires_original_data?(_, _)

Callback implementation for Ash.Policy.Check.requires_original_data?/2.

strict_check(actor, context, opts)

Callback implementation for Ash.Policy.Check.strict_check/3.

type()

Callback implementation for Ash.Policy.Check.type/0.