HomeBytesheetsRoadmapsUI TemplatesUI ToolsStack Discussion
3 Topics
Chapter•160 Minutes

Authorization Models

Design permissions correctly using RBAC, ABAC, ownership checks, scopes, and resource-level authorization.

Role-Based Access Control

Role-Based Access Control assigns permissions through roles.

Example roles may include admin, editor, and viewer.

RBAC is simple and useful when permissions map cleanly to organizational roles. However, real applications often require more context than a role can express.

For example, an editor may edit documents only inside their own organization. A global role check cannot express that relationship by itself.

Example Permissions
Admin: users:read, users:write, users:delete
Editor: users:read, users:write
Viewer: users:read

Resource-Level Authorization

Authorization must often consider the resource being accessed.

For example, GET /projects/42 should not simply verify that the user has project:read. It should also verify that project 42 belongs to an organization the user can access.

A common security vulnerability is an IDOR/BOLA problem: a user changes /users/42 to /users/43 and gains access to another user's resource because the API checks authentication but not ownership.

BOLA / IDOR

Never assume that knowing a resource identifier means the caller is authorized to access it.

Scopes and Attribute-Based Authorization

OAuth scopes provide coarse-grained permissions such as orders:read or orders:write.

Attribute-Based Access Control can evaluate attributes of the user, resource, action, and environment. For example: allow update when user.organizationId === resource.organizationId and resource.status !== 'locked'.

In complex systems, authorization becomes a policy decision rather than a simple role comparison.

Key Takeaways
  • Authentication alone is never sufficient for resource access.
  • Scopes are useful for API-level permissions.
  • Resource-level checks prevent BOLA/IDOR vulnerabilities.
  • Complex systems may require policy-based authorization.