Generates Ash policies from workflow step declarations.
Ensures workflow resources work out of the box when Authorizer
is present by injecting four layers of policies:
AshOban bypass — allows Oban-triggered actions (automatic steps and timeouts) to execute without an actor. Uses
AshOban.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, ...} endUndo 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, 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.