Access control is often treated as an afterthought in early-stage applications—usually starting as a simple isAdmin boolean or basic Role-Based Access Control (RBAC).
However, as systems grow into multi-tenant SaaS, microservices, and distributed environments, permission models quickly run into "role explosion" and complex data-scoping requirements. Broken authorization remains the #1 vulnerability on the OWASP Top 10 (A01:2021 - Broken Access Control).
The Architecture Dilemma
When designing an Access Control System (ACS) today, there are three primary models:
Role-Based Access Control (RBAC):
Great for hierarchical, static user groups (e.g., Admin, Editor, Viewer).
Falls short when permissions depend on dynamic context (e.g., "Can view document only during working hours within company IP").
Reference: NIST RBAC Standard.
Attribute-Based Access Control (ABAC):
Highly flexible, evaluating policies against subject, resource, action, and environment attributes.
Defined under NIST Special Publication 800-162.
Often implemented via decoupled policy engines like Open Policy Agent (OPA) using Rego.
Relationship-Based Access Control (ReBAC):
Modeled after the Google Zanzibar paper (Zanzibar: Google’s Consistent, Global Authorization System).
Permission is derived from object-to-object and user-to-object relationships (e.g., "Parent folder editor has edit rights on child documents").
Supported by modern open-source engines like Ory Keto, OpenFGA, and SpiceDB.
Questions for the DEV Community:
At what scale or complexity did your team outgrow simple RBAC?
Centralized vs. Decentralized Policy Enforcement: Do you favor centralized Policy Decision Points (PDP) like Open Policy Agent, or do you handle authorization locally within microservices/database queries (e.g., Row-Level Security)?
Auditability & Performance: How do you prevent access control checks from introducing unacceptable latency into your critical path without compromising audit logs?
If your team recently refactored authorization, what lessons or anti-patterns would you advise avoiding? Check the OWASP Authorization Cheat Sheet for general best practices, and share your stack choices below!
Top comments (0)