Object and function authorization
Two separate decisions
Authentication tells the service who is making a request. Authorization decides whether that identity may perform an action on a resource. In a bookstore, a customer may read their own receipt but cannot approve refunds. A receipt is an object; refund approval is a function. Both decisions belong on the trusted server.
A small permission model
Consider users Mina and Arman. Receipt R1 belongs to Mina; R2 belongs to Arman. Both have the customer role. The policy permits customers to read their own receipts only. Mina reading R1 is allowed; Mina reading R2 is denied. A role check alone would miss the ownership condition. Ownership here is stored by the application, not asserted by the client.
Function permissions
A separate refund-review role can approve refunds under a documented policy. Being allowed to view a receipt does not imply being allowed to approve a refund. Evaluate the requested action first, then any resource-level constraints. Permissions can differ between reading, editing, approving and exporting a single record.
What does not establish permission
A hidden button or a long random record identifier does not establish permission. A server must use authenticated identity and trusted resource facts. Default to denial for unknown actions or missing policy information. OWASP API Security Top 10:2023 distinguishes object-level and function-level authorization failures (API1 and API5).
Practice with an access table
Write a table for Mina and Arman reading R1 and R2, then add a refund approval column for each. For this policy both customers must be denied approval. For each cell identify the actor, action, resource and rule. Source: OWASP Authorization Cheat Sheet, and API1/API5:2023.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Object and function authorization — knowledge check
Apply authorization concepts to fictional bookstore records.
What does authorization decide?
Mina owns R1; Arman owns R2. Who may read R2 under the stated customer policy?
A customer may read their receipt. Can they approve a refund?
Which fact should establish ownership?
An action has no applicable permission rule. What is the safe default?