Policies requiring actors, vs changes requiring actors?
Ashโ Solved๐Policies
Say I have code like:
actions do create :create do change relate_actor(:user, allow_nil?: false) end end policies do policy action(:create) do forbid_if actor_absent() authorize_if always() end end
actions do create :create do change relate_actor(:user, allow_nil?: false) end end policies do policy action(:create) do forbid_if actor_absent() authorize_if always() end end
The policy seems a bit redundant with
allow_nil?: false
allow_nil?: false
on the change. But I wonder if it's worth defining anyway? I haven't explored the JSON API generation much, maybe it changes the error return? (I do see that the policy itself is insufficient, since it would authorize non-user actors)
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.