role-based-access-control

Enforce role-based access control on tRPC procedures and React UI.

1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/mealpac/manus --skill role-based-access-control
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: role-based-access-control
Source: https://github.com/mealpac/manus/tree/main/skills/development-skills/role-based-access-control
Command: npx skills add https://github.com/mealpac/manus --skill role-based-access-control

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

RBAC in modern web apps is often implemented inconsistently across backend and frontend, leading to security gaps and tangled code.

Core Features & Use Cases

  • Establish role hierarchies (admin, manager, user) and enforce access rules on tRPC procedures and React components.
  • Gate sensitive endpoints and UI elements, enabling multi-tier permissions across dashboards, data views, and admin tools.
  • Support front-end guards and backend policies that stay in sync when roles change.

Quick Start

Set up a role-aware protectedProcedure wrapper in your tRPC router and conditionally render UI elements based on user.role

Frequently Asked Questions about role-based-access-control

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

FAQPage Schema
How do I implement role-based access control in a tRPC and React application?

Implement role-based access control by creating a role-aware protectedProcedure wrapper for your tRPC routers and conditionally rendering React UI elements based on the authenticated user's role. This synchronizes API gating and frontend UI guards.

What is the best way to secure tRPC procedures based on user roles?

The best way to secure tRPC procedures is by applying a protectedProcedure wrapper that checks the role field on the authenticated user. This enforces backend access rules for admin and manager level permissions across your API endpoints.

How do I keep frontend UI guards and backend authorization policies in sync?

Keep frontend and backend authorization in sync by establishing role hierarchies like admin or manager that drive both tRPC procedure gating and React component rendering. This ensures consistent security policies across your entire application.

Does this RBAC approach support multi-tier permission hierarchies like admin and manager?

Yes, this role-based access control approach supports multi-tier permission hierarchies such as admin, manager, and user. It gates sensitive endpoints and UI elements to enforce these distinct access levels across dashboards and admin tools.

Why does role-based authorization cause security gaps between frontend and backend code?

Role-based authorization causes security gaps when implemented inconsistently across backend APIs and frontend interfaces. Applying synchronized role-aware wrappers to tRPC procedures and React components prevents these fragmented security policies.

What do I need to set up before adding role-based access control to my TypeScript app?

You need a role field on your authenticated user object and a role-aware wrapper for protected routes. These prerequisites allow you to gate tRPC procedures and synchronize UI guards based on user roles.