Authorization
An authenticated caller must not automatically be allowed to access every resource.
- SubjectSubject: A user or service requests an action.
- ResourceResource: The target and its protection needs are identified.
- PolicyPolicy: Context determines the permitted action.
Context
Why this is important
Permit actions through explicit access rules.
Permit actions through explicit access rules.
Authorization: inspect the decision
The shop example uses the existing shared database and seven modules. Any added service or deployment model is a hypothetical extension. A support agent authenticates to the shop back office. When opening order B-1042, the service checks her support role, customer relationship, and requested action. She may read status and shipping history but cannot trigger payment again. The rule is applied server-side on every access and audited with subject, resource, and outcome. A UI toggle alone would not protect the operation.
This is how you read the picture
- Subject Subject
- Resource Resource
- Policy Policy
| Concept | Meaning | Review question |
|---|---|---|
| Subject | A user or service requests an action. | Which action remains restricted to the customer flow? |
| Resource | The target and its protection needs are identified. | Which parts should an access rule name? |
| Policy | Context determines the permitted action. | Where must the rule be enforced? |
Benefits & limitations
Helps if:
- Permit actions through explicit access rules.
- Model each rule as subject, action, resource, and context.
Boundaries
- Distributed access paths can hold different policy versions.
- Resource and tenant boundaries must be checked on every API operation, including indirect object identifiers.
In practice
- Write the support rule using subject, action, resource, and context, explicitly distinguishing reading status from triggering payment again.
- Call the same order resource directly through the API with an allowed support role, a different customer association, and a forbidden action; expect server-side denial.
- Check audit records for subject, resource, action, and outcome, then repeat the test after a policy change across all relevant access paths.
Read the detailed explanation
Authorization decides whether an identified subject may perform a specific action on a resource under current conditions. A decision typically considers role, object, action, and context.
Rules can be expressed in ACLs, roles, or policies. They must apply at every relevant access point and remain revocable; successful login does not establish blanket permission.
The shop example uses the existing shared database and seven modules. Any added service or deployment model is a hypothetical extension. A support agent authenticates to the shop back office. When opening order B-1042, the service checks her support role, customer relationship, and requested action. She may read status and shipping history but cannot trigger payment again. The rule is applied server-side on every access and audited with subject, resource, and outcome. A UI toggle alone would not protect the operation. auth and authentication help compare this decision with adjacent concerns.
Check your understanding
Test yourself in three stages
ReadingCheck in the picture
Which action remains restricted to the customer flow?
View the solution with justification
Another payment attempt; support may only read order status.
ApplyingTransferred to a new situation
Which parts should an access rule name?
View the solution with justification
Subject, action, resource, and relevant context such as tenant or owner.
EvaluateWeighing an alternative
Where must the rule be enforced?
View the solution with justification
At every API operation that reads or changes protected state.
Explore further
These building blocks continue the thoughts of this page.
References
- Authorization Cheat Sheet (opens in new tab)OWASP guidance on enforcing access-control rules.
- NIST SP 800-162 Attribute Based Access Control (opens in new tab)NIST model for context-aware authorization decisions.
- OWASP Access Control Testing Guide (opens in new tab)Tests access control for protected functions and objects.