Say I have a database with the following structure:
- Permissions
- $pId (auto generated id from push)
- userId
- roomId
- permission
- $pId (auto generated id from push)
- User
- $uId
- Name
- $uId
- Room
- $rId
- Name
- $rId
Is it possible to write a rule that says "allow user to modify room if there exists a permission p where p.userId = auth.uid and p.roomId = $rId and p.permission = 'admin'"?
As far as I can tell it isn't possible without nesting permission information under each room.