Trong RBAC, quyền được gán cho vai trò (role). Cho bảng phân quyền của các vai trò và một yêu cầu role perm, hãy kiểm tra vai trò đó có quyền không.
Input:
3
admin read write delete
editor read write
viewer read
editor write
Output:
ALLOW
Vai trò editor có quyền write.
Dòng 1: n vai trò. n dòng role perm1 perm2 .... Dòng cuối: role perm cần kiểm tra.
1 ≤ n ≤ 100. Nếu vai trò không tồn tại thì DENY.
ALLOW hoặc DENY.
Ví dụ:
Đầu vào:
3
admin read write delete
editor read write
viewer read
editor write
Đầu ra:
ALLOW
Giải thích:
Đang tải editor...