On this page
Why keep the two identities separate?
Our October 2026 static study of 512 public Lovable repositories with Supabase migrations found seven additional projects with a write policy that allowed any signed-in user to update or delete whole tables. The study inspected files, so use your own fixture to check how your membership policy behaves. See the evidence
Test two tenant memberships
- 1On a local Supabase stack, create two organization records, one ordinary member per organization and one private record per organization. Give the records distinct IDs and use the same membership shape that your production migrations define.
- 2Sign in to separate local clients or browser contexts with the two test accounts. Keep the same publishable key and user-scoped client that your app uses. With each account, first check that its own seeded record is present.
- 3Request the other organization by its seeded ID through the same app route or Data API request. Assert the denial your app documents. For an RLS-filtered SELECT, assert an empty result and check that the same query still returns the row to its owner.
- 4If a user can belong to multiple organizations, repeat with a user who belongs to both, then remove one membership and check that access to only that organization goes away. Repeat through the app client as well as any pgTAP suite.
Related guides
Official docs behind this checklist
Browse all launch guides · Read resources · How to make and check your next change
FAQ for builders before launch
Can I test tenant isolation without production data?
Yes. Apply your checked-in migrations to a local Supabase project and seed fake organizations, users and memberships. Use the production policy shape with test records and credentials.
Why check that the member can read their own record first?
An empty result from the other tenant is meaningful only after a control proves the row exists and the normal user path can read allowed rows.