Role-based access control
RBAC
Role-based access control (RBAC) grants permissions through roles assigned to users. For example, a viewer can open a report, while an approver can also sign off on it.
Also known as: ролевая модель доступа
What RBAC solves
Imagine onboarding ten people who all need the same access to a billing tool. Instead of granting each person a long list of permissions, you assign them a billing role. When the job changes, you can update the role's permissions once rather than editing ten accounts. The role is a reusable set of permissions, not necessarily a copy of someone's job title.
RBAC is about authorization: whether a user may take an action. It does not handle authentication, which establishes who the user is. A successful sign-in doesn't imply permission to send an invoice.
How a decision is made
An RBAC policy connects users to roles and roles to permissions. A permission typically describes an action on a resource or resource type, such as invoice:read. An implementation may also limit a role assignment to a scope, such as a workspace. In a simple grant-only setup, the application allows a request if an applicable role grants the required permission. If no role grants it, the application denies the request. A user can have multiple roles; in this setup, the permissions from applicable roles are combined.
Example: Billing across workspaces
A billing application defines two roles:
| Role | Permissions |
|---|---|
| Billing viewer | invoice:read |
| Billing approver | invoice:read, invoice:approve |
Sam is an approver in the East workspace and a viewer in West. When Sam tries to approve an invoice, the backend looks up the invoice's workspace and checks the permissions granted there. Sam can approve an East invoice but can only read a West invoice. The approver role doesn't automatically apply everywhere.
Where it fits and what goes wrong
RBAC works well when many people need the same sets of permissions. You'll see it in internal tools, database systems, and Kubernetes. A common mistake is to treat a hidden Approve button as an access check. Hiding it helps the interface reflect what the user can do, but the backend still has to authorize the request. Another mistake is to hand out an administrator role for a routine task. Give users the narrowest role that lets them do their work, and review assignments when responsibilities change.
How it comes up in interviews
You might be asked to design a policy in which someone can approve invoices but cannot approve one they submitted. Start with a role that grants invoice:approve, then add a check that the current user is not the invoice's submitter. That distinction matters: the role grants a capability, while the extra rule depends on the particular invoice. Attribute-based access control (ABAC) expresses decisions using attributes such as the submitter, the user's department, or the request context. Applications can combine roles with these checks rather than defining a separate role for every exception.