What this thread does
The case
An internal or customer-facing admin area where different roles may view, edit or delete different records. Success looks like: logged-out visitors get nothing, a normal user cannot call an admin action directly, role is decided on the server, and someone can later see who changed what. Stack: Next.js + Supabase/Postgres.
This is a map, not new advice: every row points to an existing WhatWorks thread. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report, and none of the linked threads has one yet.
Parts, in the order people do them
| Part | What to use | Status | Link |
|---|---|---|---|
| Check the panel is not open to everyone | Test logged out; enforce roles in the backend, not hidden buttons | Untried: community post or suggestion only, no linked trial | How do I know my AI-built admin panel is not open to everyone? |
| Stop users granting themselves a role | Server-side checks on role and plan fields | Untried: community post or suggestion only, no linked trial | Can my users give themselves the paid plan or admin role? |
| Row-level security rules | Supabase RLS checklist and advisor lints | Documented: vendor or primary source, not tried (no linked trial) | How do I check my agent-built Supabase app's RLS before launch?, What does Supabase's Security Advisor flag and how do I fix it? |
| Prove one role cannot read another's data | Cross-tenant and cross-role tests | Untried: community post or suggestion only, no linked trial | How do I prove one tenant can't read another's data in Supabase? |
| Admin framework or hand-built | react-admin versus Refine, roles and audit log (free or paid) | Documented: vendor or primary source, not tried (no linked trial) | Which admin framework gives me roles and an audit log without paying? |
| User and record tables | shadcn data table on TanStack Table | Documented: vendor or primary source, not tried (no linked trial) | How do I build a data table with sorting and filters using shadcn? |
| Role claims in the Supabase JWT | No tested answer yet | No tested answer yet | none (see open request) |
| Audit log table (who changed what) | No tested answer yet | No tested answer yet | none (see open request) |
Where it breaks
- Admin data readable while logged out -> How do I know my AI-built admin panel is not open to everyone?
- A user edits their own role or plan field -> Can my users give themselves the paid plan or admin role?
- Tables readable without policies -> What does Supabase's Security Advisor flag and how do I fix it?
Open questions
- Parts marked "No tested answer yet" are gaps in WhatWorks; ask for them with the request tool so an editor can look: role claims, audit log.
Status key
Documented: the linked thread cites official docs or a vendor source and was not run. Untried: the linked thread rests on a community post or on suggestions, not run. Tried: needs a linked trial report (none yet).
As of October 2026. Not for: a data table with filters and CSV export, see case-expense-table-nextjs-supabase-filters-sort-csv-export; paid plans and billing, see case-subscription-billing-page-nextjs-stripe-webhooks; stopping bulk scraping, see stop-logged-in-users-scraping-supabase-table-edge-function.
Started from a post by @WhatWorks editors, packaged by the editor.