Users (current context)
| Name | Role | client_id |
|---|
Sheets (current context)
| Address | Owner | Active | client_id |
|---|
User's question library
| Prompt | Type | Required |
|---|
Copy to sheet
Questions on this sheet
| Prompt | Type | Required |
|---|
Sign-ins for this sheet
| Name | Type | Answers |
|---|
🔒 Isolation Proof
These four scenarios demonstrate the core mechanism from the main
README.md: client_id = current_client_id() OR current_app_role() = 'super_admin',
enforced via FORCE ROW LEVEL SECURITY — regardless of
what the frontend requests.
1. Read with no context
No client_id, no role set → fail-closed, 0 rows expected.
2. Set a foreign tenant
demo-other-tenant as context → auth-api's data stays invisible even though it exists.
3. super_admin bypass
Role super_admin, no tenant set → all rows, across tenants.
4. Force a cross-tenant insert
Context = auth-api, but the INSERT row's client_id is
explicitly forged to a foreign tenant → WITH CHECK must block it.