Hello,
I have read the beta version of the book Ash Framework. It’s something Ash needed! Congratulations @zachdaniel and @sevenseacat , I appreciate it. I’m looking forward to the new chapters!
After reading chapter 6 about Authorization, I have a question.
Imagine a typical domain where we have:
- Business (The tenant, everything is related to a business)
- has many
User
. They are managers. Each manager can modify data related to the business.
- has many
- Posts: Belong to business. The tenant is the business, and any of the managers can be the
actor
in a field likecreated_by
- Comments: Any user can create comments. The actor is the user that created the comment
What I want to check:
- Only business managers can update/delete comments
I see that the check actor_attribute_equals is very handy, but I need to check the actor following relationships on the instance being updated/deleted:
actor in (Comment -> Post -> Business -> managers)
What is the recommended Ash way to create a policy like this one?
Thanks!