I’m creating a multi-tenant application where I’d like to allow tenants to define their own roles (in addition to some standard ones). The data model that I’ve found to work is having a Roles, User_Roles and Role_Permissions (user.edit, user.view, reports.view, etc) tables. I’m using supabase, but it looks like WeWeb only works with Roles and User_Roles. How can I get that third dimension so that users can define the permissions they want for a role? I would then use role_permissions in the front-end for determining user access.
Thanks!
Hi Esowers 
WeWeb natively supports only the Roles
and User_Roles
, for the third functionality you’ll probably need to do something along this line:
• Use Supabase to manage your custom Role_Permissions
logic — define permissions (e.g. user.edit
, reports.view
, etc) and map them to roles as needed
• In the WeWeb Editor, fetch the current user’s roles and query the Role_Permissions
table accordingly
• Store the resolved permissions in a variable or in the user context
• Use that to conditionally show/hide elements or trigger logic based on the permissions available
This means the permission logic lives in your backend (Supabase), but you’re still fully in control of how things behave on the frontend.
Please experiment with this line of thought and let me know if it worked.