-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Organizations #32
Comments
I did it like this. I have an open issue and I'm not sure if this approach is the ideal approach, so some input from @point-source might be useful. I added a In order for users to exist across multiple groups and to make my application multi-tenanted, I set the My tables look a little something like this:
And with RLS policies that look like this:
|
I'm getting the error:
For the using statement. |
The AI helped me with this line:
But I still get an error:
Do you still need to pass the group_id in your requests using the supabase JS client? That is what I'm trying to avoid. |
When I was building this, I did briefly consider group hierarchies but I ultimately decided that the performance / functionality trade-off wasn't really worth it since most applications of a "parent group" are really just about sharing permissions with a larger group that just so happens to also overlap the membership of two or more smaller groups summed. This being the case, it's just as effective to use multiple flat groups in most cases since users can already belong to more than one group. Thus, the following permission models are equivalent in function: Hierarchical Exclusive Group Membership
User A is in Group 1 and can Read all and Write dogs. Flat Multi-group membership
User A is in Groups 1 & 3 and can Read all and Write dogs. Notice that without having a hierarchy, you still achieve the same functionality for permissions as well as for being able to modify group 3 and affect all users. So in this example, the "parent"ing of the group is merely a semantic label that has more to do with the permissions frontend interface rather than the function of the backend. The only time I can think of when a true hierarchical model is required is when a user may have conflicting permissions as a result of being a member of more than one group. Since this library doesn't really have the explicit concept of a negating permission though, all permissions are effectively OR'd instead of AND. So there's no priority to be determined. |
Is there a solution for organizations on top of groups?
The text was updated successfully, but these errors were encountered: