Expressing object ownership in item update permissions

I have the concepts of a group and a group admin. On the user level, there’s an ‘is admin for’ relation between users and groups. Groups can own a third data type, so this data type has an ‘owned by’ relation with a group.

I’ve set up the following item permission rule for updates to the third data type:

{"owned_by_group":{"_in":["$CURRENT_USER.is_admin_for"]}}

When I log in as a user that admins for a certain group and I try to edit an item of that group, the fields are still greyed out. Any idea why?

1 Like

It seems like this one is likely related to your other post here.

If the is_admin_for relation is a many-to-many, then you need to go through the junction table and you’ll have to go deeper into that relationship.

So the syntax may look like:

$CURRENT_USER.is_admin_for.group

or

$CURRENT_USER.is_admin_for.group_id

Something along those lines depending on your exact schema structure.