Role-based access control

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Role-based access control

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. In role-based access control (RBAC), where are permissions first given?
A To roles, like student, teacher or admin
B To each user one at a time
2. On a school network using RBAC, how does a new student get access to the student files?
A The admin sets up a new list of permissions just for them
B They are assigned the student role
3. A student is chosen as a library helper and moved from the student role to the librarian role. What happens to their access?
A It changes to match the librarian role
B It stays the same as the student role
4. Which of these is an example of a role in a school network?
A Teacher
B Password123
5. A teacher leaves the school. What is the RBAC way to remove their access?
A Delete the teacher role for everyone
B Remove their assignment to the teacher role

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1assign(user: mia, role: student) AMia is given the admin role even though she is a student, so she gets far more access than she needs.
2role: teacher -> read, write Brole: student -> read
3Changing a user's role changes what they can access CGives the user Mia the student role, so she gets all the access that the student role has
4Permissions are given to a role, not directly to each user on a school network Dassign(user: sam, role: admin)
5permission: write -> user: mia permission: write -> user: leo permission: write -> user: zoe EDefines the permissions that belong to the teacher role, so anyone with this role can read and write
6assign(user: mia, role: admin) // Mia is a student FPermissions are given to each user one at a time instead of to a role. This is slow and easy to get wrong when many users need the same access.

Definitions

Role-based access control (RBAC)

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
____ teacher = [read, write] role student = [read]
2.
role student = [read] ______ Mia to student
3.
assign Sam to student assign Sam to _______ Sam can now read and write
4.
if user.____ == "admin": allow(execute)
5.
role _____ = [read, write, execute] assign Tech_Kim to admin

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A role student = [read]
B role teacher = [read, write]
C assign Mia to teacher
D Mia can: read
Question 2
A assign Mr Lee to teacher
B role teacher = [read]
C Mr Lee can: read, write
Question 3
A role Ali = [read]
B assign Ali to student
C assign Bo to student
Question 4
A assign Zoe to student
B grant write to Zoe
C Zoe can: read, write
Question 5
A role student = [read]
B role teacher = [read, write]
C assign Jo to student
D change Jo role to student
E Jo can: read, write

Answer Key

Role-based access control
Section A: Quick Questions
Q1
A — To roles, like student, teacher or admin
Q2
B — They are assigned the student role
Q3
A — It changes to match the librarian role
Q4
A — Teacher
Q5
B — Remove their assignment to the teacher role
Section B: Match the Pairs
Q1
assign(user: mia, role: student) → Gives the user Mia the student role, so she gets all the access that the student role has
Q2
role: teacher -> read, write → Defines the permissions that belong to the teacher role, so anyone with this role can read and write
Q3
Changing a user's role changes what they can access → assign(user: sam, role: admin)
Q4
Permissions are given to a role, not directly to each user on a school network → role: student -> read
Q5
permission: write -> user: mia permission: write -> user: leo permission: write -> user: zoe → Permissions are given to each user one at a time instead of to a role. This is slow and easy to get wrong when many users need the same access.
Q6
assign(user: mia, role: admin) // Mia is a student → Mia is given the admin role even though she is a student, so she gets far more access than she needs.
Section C: Definitions
Q1
Role-based access control (RBAC) — A way to manage access by giving permissions to roles, like student, teacher or admin, then assigning each user a role. Changing a user's role changes what they can access.
Section D: Fill in the Blanks
Q1
role teacher = [read, write] role student = [read]
Q2
role student = [read] assign Mia to student
Q3
assign Sam to student assign Sam to teacher Sam can now read and write
Q4
if user.role == "admin": allow(execute)
Q5
role admin = [read, write, execute] assign Tech_Kim to admin
Section E: Spot the Error
Q1
C — Mia is a student, so she should be assigned the student role. Assigning her to teacher would give her write access she should not have.
Q2
B — The teacher role must include write so that Mr Lee can read and write. It should be role teacher = [read, write].
Q3
A — In RBAC a role is a group such as student, not a single person. The student role is never defined, so it should be role student = [read].
Q4
B — RBAC gives permissions to roles, not to individual users. To give Zoe write access, change her role to teacher.
Q5
D — Jo is already a student, so this change does nothing. To give Jo read and write access, her role must change to teacher: change Jo role to teacher.