Tenancy & access
- Every domain table carries a dealership ID, enforced NOT NULL from the first migration.
- Row-level security policies are written per command — separate SELECT, INSERT, UPDATE, and DELETE rules — so a soft-deleted row can't leak through a blanket policy.
- Role-based access control spans 160+ permissions across 16 role templates, instantiated per dealership rather than shared globally.
- Application tokens live in HttpOnly cookies and reach the API through a server-side proxy; no JWT is ever readable from browser JavaScript.
- Two-factor authentication with authenticator apps and single-use backup codes is available to every user, with an organisation-wide enforcement switch.

