Generates Ash policies from workflow step declarations.
Ensures workflow resources function by default when Authorizer
is present by injecting five layers of policies:
AshOban bypass — allows Oban-triggered actions (automatic steps, timeouts and
everyentities) to execute without an actor. UsesAshOban.Checks.AshObanInteractionwhich only matches whencontext.private.ash_oban?is true.Step-level policies — for each manual step with a
policyfield, generates a policy scoped to that step's transition actions. For example:step :review do policy actor_attribute_equals(:role, :reviewer) transition :approve, to: :done transition :reject, to: :rejected endGenerates:
policy action([:approve, :reject]) do authorize_if {Ash.Policy.Check.ActorAttributeEquals, ...} endSignal policies — for each
on_signal, a policy scoped to its generated read and transition actions that authorizessignal_in(signals_module, signal), since the listener runs as the emitting actor.Undo policy — when the workflow declares
undo do policy ... end, a policy scoped to the generated:undoaction.Default allow — a catch-all
authorize_if always()scoped to workflow transition actions, automatic step actions, timeout actions,everyactions, read actions, and user-defined create actions, so workflow initialization and background execution aren't blocked by other policies on the resource.
Skips all policy generation if Authorizer is not configured
on the resource.
Summary
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.