Web DevAuth & SecurityDiagramBeginner
Role-Based Access Control (RBAC)
KO: 역할 기반 접근 제어 (RBAC)·EN: Role-Based Access Control (RBAC)·JA: ロールベースアクセス制御(RBAC)·Role-Based Access Control
An authorization model that bundles permissions into roles (such as Admin, Editor, Viewer) and assigns those roles to users rather than managing per-user grants
Table of Contents
Structure Diagram
RBAC User → Role → Permission → Resource GraphTap a node
ROOTUser
1 linkQuick Answer
What is Role-Based Access Control (RBAC)?
An authorization model that bundles permissions into roles (such as Admin, Editor, Viewer) and assigns those roles to users rather than managing per-user grants. It is a core concept in Auth & Security within Web Dev.
Core Principles
Role-Based Access Control (RBAC) is the standard model for authorization ("what can this authenticated user do?"). Rather than assigning permissions directly to thousands of individual users, permissions (e.g., post:publish, billing:manage) are grouped into Roles (Admin, Editor, Viewer), which are then assigned to users.
Practical Takeaways
- Check permissions, not role names, in code: Write
can('invoice:delete')instead ofif (role === 'admin'). When product later adds custom roles or a "Billing Manager" tier, your authorization checks won't need rewrites. - Enforce authorization on every server endpoint: Hiding a button in React is UX, not security. Always verify permissions and resource ownership/tenant scope on the backend to prevent IDOR (Broken Object Level Authorization).
- Mind stale roles in JWTs: Embedding roles inside long-lived JWTs delays revocation when a user is demoted. Keep access tokens short-lived or check a fast permission cache for sensitive actions.
Notable Examples
- Multi-tenant B2B SaaS (GitHub, Slack, Notion): Workspace-scoped roles (Owner, Admin, Member, Guest) controlling repository and billing access.
- Kubernetes RBAC & Cloud IAM: Binding fine-grained resource verbs (
get,list,patch) to service accounts and engineering groups.