RBAC Patterns

Codify role-based access control patterns for NodeJS applications.

1|Updated Sep 14, 2025
One-click install
npx skills add https://github.com/CleanExpo/DR-NRPG --skill rbac-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: RBAC Patterns
Source: https://github.com/CleanExpo/DR-NRPG/tree/main/.skills/custom/rbac-patterns
Command: npx skills add https://github.com/CleanExpo/DR-NRPG --skill rbac-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the need for robust and scalable access control by moving beyond simple boolean flags to implement a comprehensive role-based access control (RBAC) system.

Core Features & Use Cases

  • Role & Permission Management: Define roles and map them to specific permissions (e.g., documents:read, agents:execute).
  • Multi-Layer Enforcement: Implement guards at the API (FastAPI), frontend (Next.js middleware), and database (Supabase RLS) levels.
  • Hierarchical Roles: Support for role inheritance and checking minimum role levels.
  • Use Case: Securely manage access to sensitive company documents, ensuring only authorized personnel can view, edit, or delete them based on their assigned roles.

Quick Start

Apply the RBAC Patterns skill to implement role-based access control for your application.

Frequently Asked Questions about RBAC Patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement role-based access control in NodeJS beyond simple admin flags?

Role-based access control in NodeJS is implemented by defining specific roles mapped to granular permissions like documents:read, replacing simple admin flags with a deny-by-default architecture. This uses hierarchical role inheritance to manage user access levels securely across API endpoints.

How does row-level security work with Next.js middleware and Supabase RLS?

Row-level security with Supabase RLS operates by enforcing multi-layer access guards across frontend Next.js middleware, backend APIs, and database layers simultaneously. This ensures row-level data access restrictions are validated consistently across the entire stack.

Can I use FastAPI middleware guards for hierarchical role inheritance?

FastAPI middleware guards support hierarchical role inheritance by checking minimum role levels and mapped permissions before allowing endpoint execution. This secures API endpoints by ensuring users possess the required inherited role level for access.

What is the best way to manage granular permissions for sensitive company documents?

Managing granular permissions for sensitive company documents is best handled through a role-based access control system mapping specific roles to actions like view, edit, or delete. This ensures only authorized personnel can interact with documents based on assigned roles.

When do I need deny-by-default access control in my application architecture?

Deny-by-default access control is needed when your application requires scalable security architecture that goes beyond simple boolean flags. It ensures API endpoints and data access remain secure by default, granting access only through verified hierarchical role permissions.