Generate Supabase RLS Policies
briefkit_generate_rls_policiesGenerate complete Row Level Security (RLS) policies for Supabase tables and user roles, with SELECT, INSERT, UPDATE, DELETE policies per role, admin overrides, and security notes for server-only tables.
Instructions
Generate complete Row Level Security (RLS) policies for Supabase — SELECT, INSERT, UPDATE, DELETE policies for each table and role combination. Includes security notes and server-only table restrictions.
Args:
tables (array of strings): Table names to generate policies for
roles (array of strings): User roles in the application
Returns: Complete SQL with RLS enable statements, per-table policies, admin overrides, and security notes. Handles server-only tables (payments, audit_log, webhook_events) automatically.
Examples:
"Generate RLS for profiles, orders, payments with Owner and Member roles" -> tables=["profiles", "orders", "payments"], roles=["Owner", "Member"]
"RLS policies for a marketplace with Seller and Buyer" -> tables=["profiles", "listings", "orders", "reviews", "payments"], roles=["Owner", "Seller", "Buyer", "Admin"]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tables | Yes | Table names to generate RLS policies for | |
| roles | Yes | User roles in the application |