Mastering Access Control: From ACL to RBAC and Beyond

This article explains the fundamentals and practical applications of major permission models—including ACL, DAC, MAC, ABAC, and RBAC—detailing their principles, examples, advantages, drawbacks, and how to implement them effectively in real-world systems.

Code Ape Tech Column
Code Ape Tech Column
Code Ape Tech Column
Mastering Access Control: From ACL to RBAC and Beyond

ACL Model: Access Control List

ACL is the earliest and most basic access control mechanism, based on objects. Each object maintains a list of subjects and the actions they are allowed to perform. Example: when user A tries to edit an article, the system checks the ACL for that action. Drawback: when the number of subjects grows, configuration and maintenance become costly and error‑prone.

DAC Model: Discretionary Access Control

DAC extends ACL by allowing a subject to grant its own permissions to other subjects, enabling permission delegation. Example: typical file‑system permissions in Linux, UNIX, and Windows NT. Drawback: control is scattered; a subject may unintentionally expose information because permissions are too broad.

MAC Model: Mandatory Access Control

MAC relies on a two‑way label verification: both subjects and objects carry security labels, and access is granted only when the labels match according to policy. Example: military ranks (general > colonel > major) correspond to document classification levels (top‑secret > secret > confidential); a major can only read confidential files. Drawback: overly strict, high implementation effort, and limited flexibility.

ABAC Model: Attribute‑Based Access Control

ABAC authorizes requests by dynamically evaluating a set of attributes—subject, object, environment, and operation. Attributes are typically grouped into four categories: subject attributes (e.g., age, gender), object attributes (e.g., document type), environment attributes (e.g., time, location), and operation attributes (e.g., read, write). Example: departments A and B share exam‑taking rights from 09:00‑11:00 and grading rights from 14:00‑17:00. Drawback: rule complexity makes it hard to understand relationships and difficult to implement, so it is rarely used in practice.

RBAC Model: Role‑Based Access Control

RBAC centers on assigning users to roles, where each role aggregates a set of permissions. The three core elements are users, roles, and permissions. Advantages include easier role division, flexible authorization, and fine‑grained control.

RBAC can be deepened into four variants: RBAC0, RBAC1, RBAC2, and RBAC3.

RBAC0

Defines many‑to‑many relationships between users and roles, and between roles and permissions.

RBAC0 diagram
RBAC0 diagram

RBAC1

Introduces role hierarchy; child roles inherit all permissions of their parent role, similar to a tree structure.

RBAC1 hierarchy
RBAC1 hierarchy

RBAC2

Adds constraints such as mutually exclusive roles (e.g., a cashier cannot also be an auditor) and role cardinality limits (e.g., only one CEO role). These constraints tighten security and clarify responsibilities.

RBAC2 constraints
RBAC2 constraints

RBAC3

Combines the hierarchical features of RBAC1 with the constraint mechanisms of RBAC2, offering the most comprehensive RBAC variant.

Practical Application of RBAC in Real Systems

User Management

Users correspond to employees; their organization or business‑line hierarchy can be leveraged to group them. This approach yields clear structure, good scalability, and readability.

User management
User management

Role Management

Roles should be designed after deep understanding of business logic, often mirroring actual departmental positions. Best practices include automatic assignment of base roles on onboarding, temporary roles with expiration for external collaborators, virtual roles to aggregate ad‑hoc permissions, and whitelist/blacklist mechanisms for special cases.

Permission Management

Permissions are typically controlled on three dimensions: page/menu visibility, operation rights (CRUD on specific data), and data-level rights (row‑level and column‑level). For high‑security scenarios, backend checks must enforce data permissions in addition to front‑end UI hiding.

Permission matrix
Permission matrix

Additional RBAC Practices

Super Administrator : a hidden account with all system permissions, used only for initial setup; misuse poses a serious security risk.

Mutually Exclusive Roles : when adding a new role that conflicts with an existing one, the system should prompt the administrator to remove the conflicting role first.

Simplicity : keep the permission system as simple as possible; unnecessary roles and constraints lead to unmanageable complexity as the organization grows.

Unauthorized Access Page : provide a friendly “no permission” page instead of a generic 404 when a user attempts to access a restricted resource.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

access controlAuthorizationRBACpermission models
Code Ape Tech Column
Written by

Code Ape Tech Column

Former Ant Group P8 engineer, pure technologist, sharing full‑stack Java, job interview and career advice through a column. Site: java-family.cn

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.