# Role-Based Access Control \(RBAC\)

An access-control model that assigns permissions to roles and assigns users or service identities to those roles.

- Type: framework
- Domain: Engineering & architecture
- Level: Intermediate
- Last reviewed: 2026-09-23
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/role-based-access-control/>)

## What it means

Role-Based Access Control \(RBAC\) groups permissions into roles representing responsibilities, then grants actors membership in those roles. Access decisions derive from active role assignments, and advanced models can include role hierarchies and separation-of-duty constraints.

## Why it matters

RBAC makes repeated permission sets easier to review, grant, and revoke than managing every user-action pair. Well-designed roles support least privilege, onboarding, offboarding, audits, and consistent policy across many resources.

## When to use it

Use RBAC when responsibilities are reasonably stable and many actors need common permission bundles. Attribute- or relationship-based rules may fit ownership, tenant, context, or highly dynamic decisions better and can complement roles.

## How it works

1. Inventory protected actions and group them into explicit permissions.
2. Design roles around job responsibilities rather than individual people.
3. Assign permissions to roles and actors to the minimum roles they need.
4. Evaluate active roles and resource context at every enforcement point.
5. Constrain conflicting roles and privileged activation where necessary.
6. Review assignments, unused permissions, exceptions, and role definitions regularly.

## A practical example

A commerce platform defines Support Viewer, Refund Operator, and Billing Administrator roles. A support agent can inspect orders but cannot issue refunds until an approved temporary role is activated and logged.

## Where it breaks

Roles can explode when they encode every location, project, and exception. RBAC alone handles ownership and contextual conditions poorly, and stale group membership can preserve access after responsibilities change.

## Common mistakes

- Creating a unique role for each user or one broad administrator role for convenience.
- Naming roles after teams without defining their permissions.
- Checking roles only in the interface instead of at protected operations.
- Never reviewing inherited, temporary, or unused access.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/role-based-access-control/#visualization-role-based-access-control>)

## Sources

1. [Role Based Access Control](<https://csrc.nist.gov/projects/role-based-access-control>) — NIST Computer Security Resource Center · Government research and standardization resource
2. [Authorization Cheat Sheet](<https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html>) — OWASP Foundation · Security practice guidance

## Related topics

- [Authorization](<https://wiki.soroush.uk/topic/authorization/>)
- [Authentication](<https://wiki.soroush.uk/topic/authentication/>)
- [Secrets Management](<https://wiki.soroush.uk/topic/secrets-management/>)
