Course contentsShow
← Computer Science
Lesson 2527 of 2,87256. Authentication and AuthorizationFree lesson

RBAC Hierarchies

Explore role hierarchies where senior roles inherit permissions from junior roles.

RBAC Hierarchies

What you'll learn: How role hierarchies let senior roles automatically inherit all permissions from junior roles, creating efficient permission management structures.

The Core Concept

In basic RBAC, each role has its own set of permissions. But imagine a company where a "Manager" should have all the permissions of an "Employee" plus additional management capabilities. Rather than manually duplicating every Employee permission to the Manager role, RBAC hierarchies let you define inheritance relationships between roles.

When role A is senior to role B in the hierarchy, role A automatically inherits all of role B's permissions. This creates a tree-like or directed graph structure where permissions flow upward from junior roles to senior roles.

How It Works

Think of it like a military rank structure: a Colonel can do everything a Lieutenant can do, plus more. You don't need to re-teach a Colonel all the basic soldier tasks—those are inherited automatically.

In technical terms:

  • A junior role sits lower in the hierarchy with basic permissions
  • A senior role sits higher and inherits all junior permissions plus its own
  • Inheritance is transitive: if Admin > Manager > Employee, then Admin inherits from both Manager and Employee

Example hierarchy:

Admin
  └─ Manager
      └─ Employee
          └─ Guest

Here, Admin can do everything Manager, Employee, and Guest can do. Manager inherits Employee and Guest permissions. Employee inherits only Guest permissions.

Benefits

  • Reduces redundancy: No need to duplicate common permissions
  • Simplifies management: Update junior role permissions once, and they propagate upward
  • Models organizational structure: Mirrors real-world hierarchies naturally

Key Takeaway: RBAC hierarchies use inheritance to let senior roles automatically acquire all permissions of their junior roles, creating efficient, maintainable permission structures that mirror organizational hierarchies.