#Hello,
1 messages · Page 1 of 1 (latest)
Hi @reef bay , are you asking about creating global roles that are not tied to a specific entity? Could you provide an example schema to help me understand better?
Hey @candid garnet !
What I am trying to achieve, is very similar to the "Custom Roles" (https://docs.permify.co/modeling-guides/rbac/custom-roles) permify offers.
I am working on a project which has resources / entites that occur multiple times. An example could be discord, where we have Discord-servers, which again have multiple voice- / and text-channels.
What I can now do with Permify is create the entities and permissions for those resources, as for example:
entity user {}
entity role {
relation assignee @user
}
entity server {
relation view @role#assignee
relation edit @role#assignee
}
entity voice_channel {
relation view @role#assignee
relation join @role#assignee
}
If we now assume we have one server with the voice channels "channel1", "channel2" and "channel3" I can create a role with:
- the name "channel1_member"
- permissions "voice_channel::view" and "voice_channel::join"
- for entity "channel1"
which would result in the relationships:
voice_channel:channel1#view@role:channel1_member#assignee
voice_channel:channel1#join@role:channel1_member#assignee
The problem that I have encountered though is that if I want to also have a "channel_member" role for entity "channel2" or "channel3", then I need to create a new role for each entity.
This feels a bit un-intuitive, because I would rather have a custom role "channel_member" with the permissions "voice_channel::view" and "voice_channel::join", but without directly binding it to a specific entity (e.g. channel1).
This would allow for me to later give some user the "channel_member" role for "channel1" and "channel2", and another user the same role but for "channel2" and "channel3".
And I have not found a way to do this with Permify, but am not sure if this really is something that currently cannot be done, or if I just cannot figure out how to.
Did this clarify what I am trying to achieve? If not, please do not hestitate to ask! I am grateful for any help I can get 😄