Skip to content

Instantly share code, notes, and snippets.

View TheMindFlayer's full-sized avatar

JulioIsaias TheMindFlayer

  • Dominican Replublic, Santo Domingo
View GitHub Profile
@ThingEngineer
ThingEngineer / Dynamic Multi-Tenant RBAC with Route Authorization.sql
Last active March 8, 2026 19:18
Dynamic multi-tenant SQL-based RBAC with JWT enhancement, route authorization, and permission management using Supabase.
-- Role-Based Access Control (RBAC)
-- With live propagation of roles to JWT token in a multi-tenant application using Supabase refreshSession and custom_access_token_hook
-- A method of restricting table and route access to authorized users based on their role or permission level.
-- This SQL implements a dynamic, multi-tenant role-based access control (RBAC) system with route authorization. It includes:
-- A custom access token hook that enriches JWT claims with role and company data.
-- Functions to authorize actions, check route access, and retrieve authorized routes based on user roles.

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by