How would you test object-level authorization in an API?
Answer
Create multiple identities and objects, then vary object identifiers across read, update and delete operations. Test nested resources, bulk endpoints and indirect references, and verify denial without leaking object existence or fields.
Strong answer includes
- cross-user object access
- all operation types
- no information leakage
Practical example
A tester creates two accounts, notes that account A's invoice has ID 1042, and then logs in as account B and simply changes the URL to /invoices/1042 — discovering the API happily returns account A's private invoice because it checks that the requester is authenticated but never checks that they actually own that specific invoice.