What is RBAC? Role-based access control, a permission matrix example and RBAC vs ABAC

What is RBAC? How role-based access control works, a sample permission matrix, RBAC vs ABAC and least privilege, with employee, manager and HR examples.

FUFerhat UğurluYazSis TeamPublished: November 19, 20268 min read
In short

RBAC (role-based access control) is an approach that ties permissions to roles rather than to individual people and grants access by giving users roles. ABAC, by contrast, makes each decision on the fly based on attributes of the user, the resource and the context. In business software, RBAC combined with the principle of least privilege gives most companies a sufficient and manageable setup.

Tuesday morning, three people open the same “Personnel” screen: an employee, a unit manager and an HR specialist. The only thing the employee should see is their own record. The manager needs their team’s records, and the HR specialist needs records for the whole company. The software has to give three different answers on the same screen. If permissions are set one by one for each user, hundreds of separate decisions pile up, and the risk of errors grows with every person who joins, changes roles or leaves. RBAC, or role-based access control, defines these three answers as three roles and simply assigns a role to each user.

RBAC (Role-Based Access Control) is an authorisation approach that ties access permissions to roles rather than directly to people; users gain the permissions of those roles by being given one or more roles. In this article we explain how RBAC works, how it differs from ABAC and what the principle of least privilege means in practice, using business software examples.

How does RBAC work? Three concepts

ConceptMeaningExample
RoleA bundle of the permissions a job requiresEmployee, unit manager, HR specialist, IT administrator
PermissionAn action that can be performed on a record or menuView leave request, approve leave request, edit personnel file
AssignmentGiving a role to a userA newly arrived unit manager is given the “unit manager” role

The question the system asks is not “has this person been given this permission?” but “is this person’s role authorised for this action?”. When a person changes, you change the role instead of fixing permissions one by one. If a role’s permissions are updated, everyone with that role is affected at the same time, which keeps things consistent. The table that shows at a glance which role can perform which action is called a permission matrix: roles are in the rows, menus and actions in the columns. The fictional example below maps the four roles in this article to leave, personnel file and permission actions.

Permission matrix example

RoleOwn leave requestTeam’s leave requestsPersonnel recordsUser and permission setup
EmployeeView, createNoneViews own record onlyNone
Unit managerView, createView, approveViews the team’s recordsNone
HR specialistView, createWhole company: view approved requestsWhole company: view, editNone
IT administratorView, createNoneNoneDefine, assign

What is the principle of least privilege?

The principle of least privilege says each user should be given only the permissions needed to do their job, and no more. RBAC is the tool for applying this principle; if roles are defined narrowly, the principle is maintained automatically. In business software this usually shows up in the following scopes:

  • Employees see their own record: Leave balance, list of assigned assets, their own requests.
  • Managers see their team: Their team’s leave requests and approvals; no access to records outside the team.
  • HR sees the whole company: Personnel, leave and related records; but system administration and permission setup are not HR’s job.
  • The IT administrator runs the system: Sets up users and permissions; does not need to read the contents of personnel files.

What is the difference between RBAC and ABAC?

ABAC (Attribute-Based Access Control) makes decisions based on attributes instead of roles: the user’s department, the record’s confidentiality level, the time of day, the location of the connection and so on. Although the two approaches are often presented as alternatives, in practice most systems start with RBAC.

CriterionRBACABAC
Basis of the decisionThe user’s roleAttributes of the user, the resource and the environment
Example ruleA unit manager can approve their team’s leave requestsCan approve if their department matches the record’s department and it is within working hours
ClarityHigh; shown in a permission matrixLow; harder to follow as the number of rules grows
FlexibilityMedium; very specific cases need additional rolesHigh; rules can change with the situation
Management effortLow and predictableHigher; maintaining the rules requires expertise
Where it fitsMost enterprise business softwareComplex, context-dependent access rules

The situations where ABAC is really needed are usually these:

  • Access should be granted only during working hours or only from the company network.
  • Users with the same role need access to different records depending on a record’s confidentiality level.
  • Rules keep changing for a large number of partners or external users.

Outside these situations, role, department and user layers meet the needs of most companies. Ten understandable roles are safer than an unmanageable rule engine, because being able to explain why a permission was granted is half of security.

RBAC’s weak spot: role explosion

RBAC’s known risk is the uncontrolled growth in the number of roles. When a new role is created for every exception, after a while nobody remembers what each role does and the permission matrix becomes unreadable. The remedy is simple: keep roles few, based on how the work is done; manage differences in scope (own record, team, whole company) with a layer outside the role; and handle temporary needs with time-limited permissions instead of permanent roles. A frequently recurring exception is a sign that a new role is needed – but only when it recurs.

How does a leave request pass through RBAC? A fictional example

An employee creates a leave request. The system first checks the employee’s role: the “employee” role has permission to view and create its own leave requests, but not to approve them. The request goes to the unit manager the employee reports to. The manager role has view and approve permissions on the team’s leave requests, but cannot see a request from outside its own team. Once approved, the request becomes visible to the HR role. At every step the system asks the same question: does this role have permission for this action? In a setup where people are defined one by one, every new employee and every new manager would have to be configured separately for the same flow.

Six questions when setting up role-based access control

  1. How many different roles does the company have based on how the work is done? Real differences in the work should be the basis, not the list of job titles.
  2. Which menus and records does each role need? Should viewing and acting be assessed separately?
  3. For which records does scope matter (own record, team, whole company)?
  4. For actions that require approval, can the approver and the requester be the same person?
  5. When temporary permission is needed (leave, deputising), who grants it, how, and how is it closed when it expires?
  6. Are permission changes logged, and who reads these logs?

What complements RBAC: logging and regular reviews

If roles are set up once and left alone, they drift away from reality over time. Two habits prevent this: logging permission changes and reviewing permissions regularly. The log answers “why and when was this permission granted?”; the review clears out permissions that are no longer needed. If someone changes roles and new permissions are added without removing the old ones, over the years everyone turns into a user walking around with too many permissions. The principle of least privilege is not a one-off decision but ongoing maintenance.

Can you do RBAC with a spreadsheet and manual management?

In a small team, roles can be kept in a spreadsheet and applied manually by the system administrator. The problem is that the spreadsheet and the system drift apart: the spreadsheet says “managers can only view”, but in the system one user was accidentally left with permission to act. In a multi-user, multi-module environment, having the role definition, its assignment to users and the log of changes in the same place prevents this drift.

Role-based access control in KurumsalPortal

The Menu & Authorization Management module of YazSis KurumsalPortal works with the RBAC approach: view and action permissions are defined at role, department and user layers. The flow has five steps: create the role, select the menu, define the action permission, assign it to the user, audit access. View and action permissions can be granted separately, so not everyone who needs to see information can change it.

Temporary access can also be defined: for example, the person standing in for a manager on leave is given permission for a set period. Every change to role, menu and action permissions is logged; system administrators can audit who had which permission and when. The module is based on role, department and user layers; we do not claim that it has an attribute-based (ABAC) rule engine.

If you have started thinking about your own roles, see the permission flow on the Menu & Authorization Management page and the other modules on the KurumsalPortal page.

Frequently asked questions

What is RBAC?

RBAC is role-based access control: permissions are tied to roles rather than people, and users gain access through the roles they are given. It simplifies permission management and makes it consistent.

RBAC vs ABAC: which should you choose?

RBAC decides based on roles, ABAC based on attributes of the user and the resource. RBAC is enough for most enterprise business software; ABAC is worth considering if you need dynamic rules based on time, location or a record’s confidentiality level.

What is role-based authorisation?

It is an authorisation method that determines which menus users can see and which actions they can perform based on their roles. When the role changes, the permissions change automatically.

What is a permission matrix, and what does an example look like?

A permission matrix is a table with roles in the rows and menus and actions in the columns, showing which role can perform which action. In the fictional example in this article, the employee, unit manager, HR specialist and IT administrator roles are mapped to leave, personnel file and permission setup actions.

What is the principle of least privilege?

Giving users only the permissions they need to do their job, and no more. For example, employees see their own record, managers their team and HR the whole company; nobody accesses records their work does not require.

Is RBAC enough for security on its own?

No. RBAC governs access decisions, but it should be combined with other measures such as password security, access logging, masking of sensitive fields and regular permission reviews.

FU
Ferhat Uğurlu · YazSis Team

Builds enterprise software, AI and digital transformation products together with the YazSis team.