Tenant isolation with row-level security
Database (PostgreSQL)
Every request is checked so people see only their own dealership and the locations they may access. Underneath that, the database enforces the same separation with row-level security policies on the tables that hold dealership data. The policies are keyed to the dealership's workspace, so a query can only return rows that belong to the workspace it runs for.
- The app connects with a database role that is not allowed to bypass those policies.
- The database has no public network port; only the app reaches it.
- A customer's remembered details are never shared between customers or between dealerships.
