Sooner or later a client asks the question that matters most to them: can my customers see each other's orders? Reading the access rules gives you a probable answer. Signing in as one customer and asking the database for another customer's orders gives you the real one, in about ten minutes.
This is the two-user test, done by hand against an app built on Supabase. It works the same whether the app was built in Lovable, Bolt or by hand, because it talks to the database the way the app itself does.
Why reading the rules is not enough
Row Level Security policies combine in ways that are easy to misread. Two permissive policies on the same table are joined with OR, so a careful rule next to a loose one is as open as the loose one. A view can read a protected table with its owner's rights. A policy added last month to fix an error can undo one written at launch. Five policies that leave a table open walks through the common cases.
Supabase's dashboard can run queries as a chosen user, which its documentation calls user impersonation, and that is a quick first look. The test below goes one step further: it sends the same request a browser would, with the same public key and a real session, so nothing in between is assumed.
Step 1: Create two test accounts with data of their own
Create two ordinary accounts in the app, A and B, with email addresses you control. Plus addresses work well: you+a@example.com and you+b@example.com reach the same inbox in most mail services. Never use a real customer's account.
Then use the app as B and create something in every part that holds personal data: an order, a message, a profile with a phone number, an uploaded file. This step is the one people skip, and it decides whether the test means anything. An empty answer from a table where B has no rows tells you nothing.
Finally, find B's user ID. It is listed under Authentication, Users in the Supabase dashboard, and it is the value most tables use to say who owns a row.
Step 2: Sign in as A
You need two values from the app's code, both public: the project address, which looks like https://abcdefgh.supabase.co, and the publishable or anon key. Both are in the app's JavaScript, and in the project's API settings. With those, sign in as A from a terminal:
curl -s "https://abcdefgh.supabase.co/auth/v1/token?grant_type=password" \
-H "apikey: PUBLIC_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"you+a@example.com","password":"A_PASSWORD"}'
The answer contains an access_token. That is A's session, a JSON Web Token that tells the database who is asking. Copy it for the next step.
Step 3: Ask for B's rows
Now ask a table for everything A can read, sending both the public key and A's token:
curl -s "https://abcdefgh.supabase.co/rest/v1/orders?select=*" \
-H "apikey: PUBLIC_KEY" \
-H "Authorization: Bearer ACCESS_TOKEN"
Then ask directly for B's rows, using the column that holds the owner:
curl -s "https://abcdefgh.supabase.co/rest/v1/orders?select=*&user_id=eq.B_USER_ID" \
-H "apikey: PUBLIC_KEY" \
-H "Authorization: Bearer ACCESS_TOKEN"
Read the answer like this:
- Rows that belong to B. The table is open between users. Any signed-in customer can read every other customer's rows in it. This is broken access control, the most common flaw in web apps.
- An empty list,
[], while B has rows there. The table keeps B's rows from A, for reading. This is the answer you want. - An error with code
42501, or a 401. The signed-in role has no access to the table at all. Fine for reading, but check that the app does not need it. - An error saying the table does not exist. The name is wrong, or the table is not exposed through the API. Check the name in the app's code.
Step 4: Repeat for every table and for files
The table names are in the app's code, wherever it calls .from('...'). Go through each one that holds anything personal. Views count too: a view of order totals can show what the orders table hides.
Uploaded files are easy to forget and often hold the most personal data in the app. If the app uses a storage bucket with a folder per user, which is the usual layout, ask it for the list of B's folder with A's token:
curl -s "https://abcdefgh.supabase.co/storage/v1/object/list/BUCKET" \
-H "apikey: PUBLIC_KEY" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"prefix":"B_USER_ID","limit":100}'
A list of B's file names means A can see what B uploaded, and in a public bucket also download it.
Leave writing alone on a live app
The same test can be extended to adding, changing and deleting rows, and on a copy of the project that is worth doing. On a client's live app, do not. A write that succeeds has changed real data, and one that touches the wrong row cannot be taken back by apologising. For writes, read the policies for insert, update and delete instead, and look for the ones whose condition is simply true or that never compare the row's owner with the user's ID.
Run it again when the app changes
A passed test answers for the tables that existed on the day it ran. The next prompt that adds a feature can add a table with looser rules, and the test does not know about it until someone runs it again. That is why it belongs in a maintenance plan rather than in the handover alone: two test accounts that stay in the app, and the same requests repeated after every change. Keep the accounts' passwords somewhere safe, and remove the accounts if the plan ends.
When a client asks whether their customers can see each other's data, "we tested it last night, with two accounts, and they could not" is an answer they will remember.