Strategy for Defining Permissions/Roles With Resource Granularity #112
-
Hi I'm trying to use Fief for a project but I don't have experience with defining roles and permissions. How would I go about defining RBAC similar to say GitHub or GitLab where there are high level roles (Guest, Maintainer, Owner) etc but those roles are administered on a per-repository basis? After reading the tutorial, it seems that one way to do it would be to make "Repo X Guest/Maintainer/Owner" roles for each repo... but that doesn't seem quite right. Any thoughts/guidance on what would be the best way to go about this? Discussion #24 might be relevant... is what I'm looking for simply not supported yet? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hail, @marcodlk 👋 Welcome to Fief's kingdom! Our team will get back to you very soon to help. In the meantime, take a minute to star our repository ⭐️ Farewell! |
Beta Was this translation helpful? Give feedback.
-
Hi @marcodlk 👋 Right now, it's not possible to define roles/permissions at a resource level. Since it's highly dynamic (new resources are added constantly in your app), it would be quite complicated and slow to manage it a Fief level, because you would have a lot of back and forth between your server and Fief. I suggest you implement it in your own application, with your own logic. It can be as simple as a relationship table linking a user id, a resource and the associated permissions. Something like this:
|
Beta Was this translation helpful? Give feedback.
Hi @marcodlk 👋
Right now, it's not possible to define roles/permissions at a resource level. Since it's highly dynamic (new resources are added constantly in your app), it would be quite complicated and slow to manage it a Fief level, because you would have a lot of back and forth between your server and Fief.
I suggest you implement it in your own application, with your own logic. It can be as simple as a relationship table linking a user id, a resource and the associated permissions. Something like this: