A tenant scope limits each database query to records owned by the authorized customer or organization. In a shared-table design, the application must apply that scope consistently; one missing condition can expose another tenant’s data. section 7.4
Proving the administrator’s tenant
A cancellation flow first reads User, Membership, and Team before touching the booking. Those checks establish that the administrator belongs to the correct organization; only then should the flow access the booking. section 7.4
Apply tenant scope through the data model and every query:
- Tag rows through the ownership hierarchy, such as team belonging to a parent organization. section 7.4
- Add the relevant tenant condition, such as WHERE teamId = ?, to every shared-table query. section 7.4
- Treat omitted scope as a data-leak defect, not merely an incomplete filter. section 7.4
Figure 7.6 In a shared table, the application enforces tenant isolation by adding WHERE teamId = ? to every query. Forgetting this clause leaks one tenant's private data to another.

Trace how application-enforced WHERE conditions preserve isolation in a shared table. section 7.4
