Ash FrameworkAF
Ash Framework7mo ago
6 replies
Quentin

policies are still filtering relationships even though archive_related_authorize? is set to false

Case 1:

task.ex
  archive do
    archive_related([:solutions])
    archive_related_authorize?(false)
  end


+

task_solution.ex
    policy action(:destroy) do
      # authorize_if relates_to_actor_via(:created_by)
      authorize_if always()
    end


=> the relation is archived ✅

task_solution.ex
    policy action(:destroy) do
      authorize_if relates_to_actor_via(:created_by)
      # authorize_if always()
    end


=> the policy check misses, the relation is not archived ❌



Not sure but I don't think this is the expected behavior.
Was this page helpful?