rbac-permission-system

Enforce role-based access control across API routes, UI elements, and data access.

Updated Oct 10, 2025
One-click install
npx skills add https://github.com/doorscomputers/nextjspos --skill rbac-permission-system
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rbac-permission-system
Source: https://github.com/doorscomputers/nextjspos/tree/main/.claude/skills/rbac-permission-system
Command: npx skills add https://github.com/doorscomputers/nextjspos --skill rbac-permission-system

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a centralized, reliable system for enforcing role-based access control (RBAC) across applications, ensuring users see and act only on what they are authorized to access.

Core Features & Use Cases

  • Permission aggregation: combines role-based and direct permissions and supports a Super Admin override.
  • API & UI protection: guards API routes and hides/shows UI elements based on permissions.
  • Data access control: enables field-level security and location/multi-tenant filtering through helper utilities.
  • Use Case: when implementing a new module, you can rapidly plug in hasPermission checks and PERMISSIONS constants to govern access.

Quick Start

Define your user with roles and permissions, then start guarding routes and UI with the helper functions.

Frequently Asked Questions about rbac-permission-system

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

FAQPage Schema
How do I enforce role-based access control across both frontend UI and backend API routes?

Role-based access control across frontend and backend APIs is enforced by aggregating runtime permissions from assigned roles and direct grants. You apply helper utilities like hasPermission to gate UI elements and protect API routes.

What is the best way to implement multi-tenant data filtering in an RBAC system?

Multi-tenant data filtering in an RBAC system is implemented through built-in data access control helpers. These utilities provide field-level security and location-based filtering to restrict data visibility based on aggregated permissions.

How does permission aggregation work when a user has both direct permissions and role-based permissions?

Permission aggregation combines direct permissions with role-based permissions at runtime. The system merges both sources to determine effective access, and a Super Admin override bypasses standard checks to grant unrestricted access.

Can I check if a user has all required permissions or just any one of them before showing a UI component?

Yes, you can verify if a user has all required permissions or any one of them using the hasAllPermissions and hasAnyPermission helper functions. These utilities evaluate aggregated runtime permissions to conditionally render UI components.

Does this RBAC permission system support a Super Admin override for unrestricted access?

Yes, the RBAC permission system supports a Super Admin override for unrestricted access. The isSuperAdmin utility identifies these users, allowing them to bypass standard permission checks across the application.

How do I standardize permission references across my application code to prevent authorization errors?

You standardize permission references by using a shared PERMISSIONS constant across your application code. This centralized constant ensures consistent permission string usage with helper utilities, preventing authorization mismatches during UI gating and API protection.