RBAC and multi-tenancy in supabase #30434
-
Hello everyone, I am currently working on a SaaS boilerplate using React, Next.js, Shadcn, Tailwind, and Supabase. I am looking to implement role-based access control (RBAC) and multi-tenancy in my project. I've come across some repositories that might address my requirements: Basejump : https://github.com/usebasejump/basejump?tab=readme-ov-file As a beginner with RBAC and multi-tenancy, I would appreciate advice on whether I should use a third-party library or proceed with Supabase’s native RBAC. My concern is that Supabase RBAC doesn’t appear to have specific docs or guidance for multi-tenancy. Any suggestions or insights would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
My advice would be define your use cases first ( throughly ). Watch videos like this and define your use cases then select a tool. Try not to overcomplicate things. Because it easily becomes complex. Watch this video. It is about CLerk platform. But it will give you the rough idea. Specially that One last thing about why it becomes easily complex is : Postgre RLS runs on every record of your table. that means if you have million rows your table, RLS query will run million times. If you put JOIN in that table's RLS, then performance will be a problem. if your data is not going to exceed 10,000 rows, it may not be a problem. That is all I know. |
Beta Was this translation helpful? Give feedback.
My advice would be define your use cases first ( throughly ).
who can do what. who can register whom. who cannot do what ...
Maybe You only need multitenant check OR multitenant and role check OR multitenant, role and permission check OR maybe you need ABAC not RBAC ...
Watch videos like this and define your use cases then select a tool. Try not to overcomplicate things. Because it easily becomes complex.
Watch…