Authorization enforces what an authenticated principal may do—read own orders vs admin delete all users.
Models
- RBAC — roles (editor, admin) map to permissions
- ABAC — attributes (department, clearance) on policies
- ACL — per-resource access lists
Check server-side
Never rely on hidden UI buttons—attackers call APIs directly. Enforce on every endpoint.
IDOR
Insecure Direct Object Reference: changing ?id=123 to another user's id—fix by scoping queries to current user.
Important interview questions and answers
- Q: RBAC?
A: Users get roles; roles grant permissions. - Q: IDOR fix?
A: Authorize resource access against session user id.
Self-check
- What is RBAC?
- Why enforce authorization on the server?
Tip: Add automated tests: user A cannot access user B's resource id.
Interview prep
- IDOR?
Accessing objects by changing identifiers without authorization.