SecurityRBACrolesrole-based authorization

Role-based access control

Definition

RBAC grants permissions to roles such as viewer, editor or admin and assigns users or services to roles; a request is allowed if any of the caller's roles holds the required permission.

In practice

RBAC is easy to reason about and audit: list the roles, list who has them. It suits coarse, function-level decisions (who may open the admin console, who may deploy) and appears everywhere, from Kubernetes Role and RoleBinding objects to database grants and SaaS admin panels.

Roles cannot express "only your own records" without help, so teams invent ever more specific roles until nobody understands them (role explosion). Object-level rules usually need attributes or relationships on top. Roles copied into long-lived tokens also keep working after they are revoked, until the token expires.

Example

In a billing app, support may read invoices, finance may also issue refunds, and admin may manage users; Bob is in support, so POST /refunds returns 403.