Skip to content
Get App

Lecture 29 Chapter 04 section 4.6 Role based Access Control

Lecture on RBAC (Role-Based Access Control): users, roles, and permissions, many-to-many relations, comparison with DAC, least privilege, and RBAC constraints.

Key Takeaways

  • RBAC assigns permissions to roles, and users obtain permissions through the roles they hold.
  • The many-to-many user-role and role-permission relationships make RBAC scalable and flexible.
  • RBAC centralizes access management, so job changes require only role updates rather than per-resource changes.
  • Following least privilege and activating only the needed role per session reduces security risk.

What the video covers

  • Introduces Role-Based Access Control (RBAC), where permissions are tied to a user's organizational role rather than to individual identity.
  • RBAC requires three elements: users, roles, and permissions.
  • Assigning permissions to roles instead of individual users makes administration easier; changing a role's permissions updates all its users at once.
  • The relationship is many-to-many: a user can hold multiple roles, a role can have multiple permissions, and a role can be assigned to multiple users.
  • Compares RBAC with Traditional Discretionary Access Control (DAC), where access is based on user or group identity and administration is complex and decentralized.
  • Describes RBAC representation as two database tables: user-to-role assignments and role-to-permission assignments.
  • Explains the Principle of Least Privilege: give roles only the minimum permissions needed, e.g., a lecturer may edit grades only for their own courses.
  • Benefits include limiting damage from compromised accounts, reducing accidental changes, and reducing opportunities for misuse.
  • Introduces RBAC levels: RBAC0 (basic), RBAC1 (role hierarchies), RBAC2 (constraints), and RBAC3 (combined), with hierarchies allowing senior roles to inherit junior permissions.
  • Covers constraints such as mutually exclusive roles, cardinality limits, prerequisite roles, and session-based role activation.

Answers

Questions about this video

What are the three core components of RBAC?

The three components are users, roles, and permissions. Users are individuals accessing the system, roles represent their function or duty, and permissions are the authority attached to each role.

Why is RBAC described as a many-to-many relationship?

A user can hold multiple roles, a role can contain multiple permissions, and a role can be assigned to multiple users. This flexibility is why the relationship is many-to-many.

How does the Principle of Least Privilege apply in RBAC?

Each role is given only the minimum permissions needed for its tasks, such as a lecturer editing grades only for their own courses. Users should also activate only the role required for the current task.

Full Transcript — Download SRT & Markdown

00:00
Speaker A
In the name of God, the Most Gracious, the Most Merciful. We will talk about section 4.6, Role-Based Access Control, or RBAC. Okay, what does Role-Based mean? As the name suggests, "Role" refers to a function or duty. I determine the permissions I have based
00:12
Speaker A
on my role in the organization. If your role is an Administrator, it means you are a system manager. What are your permissions then? System manager permissions. If your role is an Executive Manager, your permissions are executive. If your role is a Financial
00:24
Speaker A
Manager, your permissions are only financial. You will receive the permissions related to a Financial Manager. Are the permissions assigned to you based on your name? No. Are they based on specific categories? No.
00:35
Speaker A
Permissions are taken based on the role you represent for me, okay. Therefore, your permissions are a different type of access control, okay. Access rights depend on whom? On the role you represent. On the role that you occupy.
00:52
Speaker A
So, in this case, what do I need? I need three things: User, Role, and Permission. As for the user, an individual who accesses the system, okay. The role is who you are.
01:04
Speaker A
Administrator, Lecturer, Student. And the permission is the authority you hold. As a lecturer, what permissions do you have? As a student who entered our university system, what permissions do you have? Okay, so now we need to talk about what? About roles. Every
01:24
Speaker A
role has its own permissions. Without RBAC, without Role-Based Access Control , what would I have to do? I would have to go to every user and say: "Here is your access to the first file.""And for the second, third; here are your
01:33
Speaker A
permissions from me." I go to the second user, same thing. Third, fourth, and fifth. Well, what if these five users actually share the same role?
01:40
Speaker A
They are, for example: Students. Do I need to take each student every time and give them these five permissions; give each student these three permissions? Or can I define a role?
01:50
Speaker A
For example, let's talk about a lecturer. Define a role for a lecturer. You, as lecturers, are people who attend lectures. Therefore, you have the same access permissions. Okay. So, it is only your role that determines your permissions. I assign the role to
02:04
Speaker A
you once. And after that, what permissions do you get based on the role? Well, what if I want to change the level of permissions without RBAC here? Without roles, what would I do? I would have to go around to the five
02:15
Speaker A
users I have. For each one, I would change the permission. Whether to give them a new permission or remove an existing one. But with RBAC, it tells me no. You just come to the role and give it a permission or take one away.
02:26
Speaker A
Therefore, the process of adding permissions and managing them in the case of Role-Based Access Control will be much stronger. Okay. And much easier . Well, as it is, concerning Role-Based Access Control, okay? Its relationship is many-to-many. How is it many-to-many
02:42
Speaker A
? For example, I have the Student role, or let's say the Lecturer role. I have two lecturers, two students, or two users who have taken the lecturer role.
02:54
Speaker A
Well, for the lecturer themselves, do they get one permission or multiple permissions? They have multiple permissions for the files we have, okay ? A user may have multiple roles.
03:08
Speaker A
Meaning my user themselves, for example , Sarah, at the same time can have multiple roles, okay? Now, a role has multiple permissions. Does my role have one permission or multiple permissions?
03:21
Speaker A
No, the role has multiple permissions, okay? A role may be assigned to multiple users. Can I assign the role to a user or many users? I am saying, can I give it to whom? Can I give it to
03:33
Speaker A
multiple users? To multiple users. Well , can their permissions be shared between multiple roles? Yes, my permissions can be shared between multiple roles. Meaning, I can, for example, view courses. Who gets to see them? The admin and the lecturer. The
03:55
Speaker A
admin, the lecturer, and the student. Okay, because it is a permission we have. Well, what is the difference? Or if we compare Role-Based Access Control and Traditional Discretionary Access Control, what is the difference?
04:07
Speaker A
Role-Based is built on what? On roles, while the traditional one is built on what? On user identity, built on what?
04:15
Speaker A
On the user's identity and not on the user's role, okay? For permissions, we said in the case of Traditional Discretionary Access Control, the permission is based on what? On the user or group that will get access.
04:30
Speaker A
Okay. Based on the user ID and group ID , you will have access. While in Role-Based, it is based on the permission assigned to you.
04:36
Speaker A
Administration is difficult and complex in the case of DAC. While in RBAC, it is centralized through role management.
04:44
Speaker A
For example, you can give control to its file, while...Access permission or ...Without it. When the RBAC user changes their job in the organization.
05:03
Speaker A
The administrator simply updates the role. And consequently, you only have the new permissions without needing to change permissions on every resource we have. Okay. If we talk about how RBAC is represented. I say I have two matrices. The first matrix will
05:23
Speaker A
determine the user's roles. The second matrix will determine the permissions of the role. Clear. So I have two tables in the database. The first table . The first table. In the database, it will determine for each user what roles
05:44
Speaker A
they have. Each user, what role they have. The second table in the database will determine for each role what permissions it has. What permissions are there, who has them. Okay. A user can have more than one role. And a role
05:59
Speaker A
can have more than one permission. As we said, why? Because it is many-to-many. Okay. Many, okay. Well, Principle of Least Privilege. Okay. I have a role. I will give it the minimum amount of permissions. So they can perform their tasks. Should I give them
06:23
Speaker A
more permissions than that? No, don't give me any more authority than that. Hector can update his courses only. As a lecturer, I only have the authority to edit what? That is, the grades for the courses I teach only. Well, a poor
06:37
Speaker A
practice, or a practice that is incorrect or wrong, is that every instructor can access. Access all files for all the courses at the university.
06:49
Speaker A
Even the ones they don't teach, and this is completely wrong. So, what do we have in RBAC? Assign only required roles. Avoid administrative, okay. I want to greatly avoid any unnecessary supervisory privileges, okay. Activate only one role, okay. You have, for
07:13
Speaker A
example, a supervisor role and a lecturer role. So, how is the authority set when you enter to edit a course grade? It gives you. Only the lecturer privilege. If you want to enter the system as a system administrator, what
07:30
Speaker A
will you do? You will activate the administrator role. Review the assignments, okay. Well, review assignments regularly. So, what are the benefits? Limit the impact of compromised accounts, okay. Therefore, if a specific account is stolen. Its impact will be very small for us. Why?
07:53
Speaker A
Because it only. It will only control the minimum privileges granted to it. Consequently, its impact on the system will be minimal. Meaning, let's assume an attacker or hacker stole the account of a specific lecturer in our system.
08:09
Speaker A
Now, will they be able to change all university students 'grades? Or only the grades of the students that this instructor teaches? Only the grades of the students this instructor teaches, changes, okay. Since you, as an instructor, only have the authority to
08:26
Speaker A
change the grades of your courses, you cannot change other courses' grades. Thus, I will reduce the accidental changes, okay. Reduce opportunities for misuse, which is the usage, reduce the probabilities or chances of misuse.
08:46
Speaker A
Meaning, instead of the instructor entering to access student grades in another course without the other teacher knowing. So, what will I do? As long as I only give them authority over their own course, what will I do? I
08:57
Speaker A
will reduce the opportunities to misuse the existing privileges. It says every RBAC reference model has four levels.
09:05
Speaker A
RBAC 0, 1, 2, and 3, okay. Our basic model is RBAC 0, okay. The basic model divided it into users, roles, permissions, and sessions, minimum functions, okay. This was our main function: users, roles, permissions, and sessions, okay. Well, RBAC 1 says
09:25
Speaker A
no, it is Hierarchical RBAC. Okay, as a user, you are indeed divided into users , roles, permissions, and sessions, but I have another thing, which is a hierarchy. If I said you are a manager, you have taken the lecturer's
09:37
Speaker A
privileges, for example, along with the manager's, okay. And we get a hierarchy in the privileges. Therefore, the higher authority takes the lower authorities beneath it. The constrained RBAC, which is RBAC 2, said it is basically RBAC, but what did it do? I
09:56
Speaker A
added what are considered additional conditions. To create a separation between permissions and the number of permissions for each one. After that, it told me RBAC 3; it said, no, here I want to combine RBAC 1 with RBAC. So
10:08
Speaker A
RBAC 3 became the one that is the combination of these three. Okay. It accepts the base model that we talked about at the beginning. Our RBAC for the role. Here is RBAC 2; of course, RBAC 1 and RBAC 2 have an intersection.
10:23
Speaker A
Okay. RBAC 2 was when we added constraints. RBAC 3 we called consolidated. What did it do? It took both of them together. Okay. What is the model on RBAC? RBAC 1 added hierarchies, RBAC 2 constraints, and RBAC 3 took both of them together?
10:40
Speaker A
Which is the constraints and which is ...Which is the hierarchy, okay. Well, we talked here in RBAC 0 about users, roles, permissions, and sessions. Users we talked about. Roles we talked about.
10:53
Speaker A
And permissions we talked about. What is meant by session? Okay. It tells me I have a user with a role. Now he wants to enter the session. In this session, if you have more than one role, you must specify only one for this session.
11:09
Speaker A
Okay. Based on this role, you will have access to the permissions we have. Yes, the user is an individual system identity. The role is an organization.
11:26
Speaker A
So, the permission is an authorization for you to perform specific operations on a specific resource in. The system.
11:38
Speaker A
Okay. You will take from the role you have, okay. And it gives you the permission based on a specific timeframe. Okay. Which is sessions and the principle of least privilege for the user. Activate only the role for the task. Meaning if you are a user
11:59
Speaker A
with permission for department data. And permission to access the course materials. What you have are the necessary materials for the course you are taking. So you will now enter the system. I will either activate this for you. Or activate that for you,
12:14
Speaker A
depending on the session you are in. Okay. Depending on the session you are in. Are things clear? Consequently, we will also apply the principle of least privilege. Meaning, quite simply, you can manage department accounts. You can create an account, suspend an account,
12:32
Speaker A
but you cannot enter another user's account to activate their courses. Only they have the permission to go in and activate their courses. Therefore, each role has several sessions. Each session will give you only the minimum permission to perform the tasks of this
12:50
Speaker A
session only. Are things clear? Well, role hierarchies and inheritance. It tells me if I have an engineer. What does an engineer have? Only engineer permissions. Well, if this engineer was a quality engineer. He would have engineer permissions and quality
13:06
Speaker A
inspection permissions. Well, if this was a product engineer. It would be an engineer plus product permissions. Okay . Well, if it was a project lead, meaning a project manager. He would then have the project engineer and quality engineer permissions in the
13:22
Speaker A
same role. Okay. Inheritance makes the process of managing permissions for us what? It is simplified and easy.
13:36
Speaker A
Therefore, I won't need to perform repeated permission access. Alright. Okay, what constraints do we have on Role-Based Access Control? Or roles, or what? These are the constraints in Role-Based Access Control. It tells me, first, we have Mutually Exclusive Roles
13:52
Speaker A
. Alright. What does that mean? Cannot be assigned to activate conflicting roles. If I have a person with conflicting permissions, I don't let them activate them at the same time.
14:04
Speaker A
Either this or that. Consequently, they can't do what? Request and approve the same thing. It's not right for my person, okay, the person with me, to have the authority to create a request, for example, a payment request. Then,
14:18
Speaker A
they are the same one to approve the payment request. Another thing, it says Cardinality Constraints. What does Cardinality Constraint mean? I want to define the number of users who use each role. Right, so only one user, for example, may hold the department head
14:34
Speaker A
role. Right, so each role I have must have a specific number. For example, can there be two department heads? No, only one. Well, can I have 10 lecturers in the department? Yes, that's fine.
14:47
Speaker A
Right, so each role I have will have what? Cardinality constraints. Right, another thing, the third constraint is Prerequisite Roles, okay. What does that mean? Prerequisite conditional roles. Require a role before you can...
15:03
Speaker A
Meaning, for example, a person must be an engineer before being a project manager. Clear? So, we have prerequisite conditional roles. So, RBAC, which we were talking about, says there are three things. That I am forbidden from giving mutually
15:20
Speaker A
exclusive roles, Mutually Exclusive Roles. Meaning, whoever initiates the payment process is not...Meaning, it's not possible for them to be the one who approves the payment process. Thus, I will ensure that my data, I will ensure data integrity. The thing. Second. And
15:37
Speaker A
every role might have a specific number of people holding that position. Meaning, I cannot have more than one CEO for the company. I cannot have more than one department head. Therefore, every role has its own Cardinality Constraints. The third thing, some
15:49
Speaker A
roles have prerequisites. Meaning, you cannot be a project manager if you are not already an engineer. Right. The basic idea is, this constraint helps enforce Separation of Duties. It supports, for us, the separation between permissions. And it reduces the
16:07
Speaker A
risks of use. Which is, the misuse of who? The permissions. Clear, right? What is the separation between permissions, or the separation of duties? Right. Separation of duties; I have some sensitive operations, like financial operations. I want to separate the users and permissions that
16:30
Speaker A
execute a single operation. Therefore. No one person can control the entire process. Thus, UI, for example, in a payment process, we have an employee requesting a payment. Does the same employee complete the operation? It says no. Another employee must approve
16:46
Speaker A
the payment process. And then the system authorizes the payment for you. If the same employee requested the payment and approved the payment, what happened? It means the user could misuse it. Using the system and performing operations without any
17:00
Speaker A
oversight or accountability. And this is completely wrong. And this is clearly wrong, the matter is clear. The security goal of all this is that I want to prevent one person from doing all the steps of sensitive operations without clear external oversight. That
17:22
Speaker A
is how we finish section 4.6, which is Access Control. Hopefully, in the next video, we will cover section 4.7.
Topics:RBACRole-Based Access Controlaccess controlpermissionsleast privilegeDACrole hierarchysecurityinformation securitylecture

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries and speaker detection. 30 minutes free.

Or transcribe another YouTube video here →