How would you approach object-level authorization across user roles and tenants?
Answer
Start by mapping assets, actors and trust boundaries: which object types exist, which role or tenant should own each one, and where the ownership check actually happens. Focus on object-level authorization across user roles and tenants. Use explicit, server-side authorization rules and secure-by-default access as the oracle, never client-side hiding or an assumption that a valid session implies a valid owner. Cover cross-tenant object-ID substitution, role-to-role privilege differences, and data leakage through error responses that reveal an object exists even when access is denied. Keep a regression matrix of every role against every other tenant's object IDs so a bypass can be reproduced and retested. Release only when every object-fetch and object-mutation endpoint rejects a mismatched tenant or owner with a safe, uninformative failure.
Strong answer includes
- explicit risk and test oracle for object-level authorization
- tests server-side authorization, not client-side hiding
- covers cross-tenant and cross-role object-ID substitution
- measurable evidence and residual-risk statement
Practical example
A tester logged in as Tenant B's regular user and changed an invoice ID in the URL to one belonging to Tenant A, and the API returned the full invoice instead of a 403. The fix required adding an explicit tenant-and-owner check on every object-fetch endpoint, plus a regression test matrix covering every role against every other tenant's object IDs.