01
Tenant isolation
Each operator is a tenant. Isolation is enforced where data is read and written, so a mistake in an interface cannot expose another tenant's data.
How it is designed
- Every record carries a tenant identifier, and every query is scoped by it in the data layer.
- API keys and staff sessions are bound to one tenant. A request parameter cannot widen that scope.
- Events, exports and webhooks are scoped the same way as queries.
- Inside a tenant, brand-level scoping limits what each team can see.
-- scope is added by the data layer, not by the caller SELECT id, amount, status FROM transactions WHERE tenant_id = :session_tenant AND brand_id IN (:allowed_brands) AND player_id = 'pl_9041';