Policies: authorize if user is an admin of the requested resource's organization
I have a group resource with these relationships:
And an organization resource with these:
And a user resource with this:
And this read action:
I'm trying to write a policy that applies to read actions like the above that only shows groups that:
a) the educator is the owner of
b) the educator is an admin inside the group that the organization belongs to
I got the first one working, but the second bit I don't know how to go about. Basically a policy that checks the group's organization_id and then checks the actor's organization_memberships, finds that org with that id and checks to see if the
And an organization resource with these:
And a user resource with this:
And this read action:
I'm trying to write a policy that applies to read actions like the above that only shows groups that:
a) the educator is the owner of
b) the educator is an admin inside the group that the organization belongs to
I got the first one working, but the second bit I don't know how to go about. Basically a policy that checks the group's organization_id and then checks the actor's organization_memberships, finds that org with that id and checks to see if the
role attribute on it is admin.