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
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
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
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.
3 Replies
ZachDaniel
ZachDaniel4mo ago
@Arago yes I think a case was missed w/ the new change Can you try main of ash_archival?
Quentin
QuentinOP4mo ago
checking. @ZachDaniel works now, thank you !
ZachDaniel
ZachDaniel4mo ago
Will release soon

Did you find this page helpful?