role-based-access

Implement RBAC enforcement across backend endpoints and frontend hooks.

Updated Nov 2, 2025
One-click install
npx skills add https://github.com/PrasadTelasula/EvokeQOne --skill role-based-access
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: role-based-access
Source: https://github.com/PrasadTelasula/EvokeQOne/tree/main/.claude/skills/role-based-access
Command: npx skills add https://github.com/PrasadTelasula/EvokeQOne --skill role-based-access

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implements role-based access control (RBAC) with admin, lead, and member roles and middleware protections.

Core Features & Use Cases

  • Permission decorator and endpoint dependencies
  • Frontend hooks to check roles
  • Role-based protections on critical endpoints

Quick Start

Annotate endpoints with require_role("admin","lead") and test with tokens from users with those roles.

Frequently Asked Questions about role-based-access

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

FAQPage Schema
How do I implement role-based access control in FastAPI endpoints?

Role-based access control in FastAPI uses decorators and middleware to enforce permissions on endpoints. Apply a require_role decorator to endpoints specifying which roles (admin, lead, member) can access them, combined with middleware that validates user tokens and attaches role information to requests before reaching your endpoint handlers.

What's the difference between admin, lead, and member roles in RBAC?

Admin roles have full system access and can manage users and permissions. Lead roles manage content and team resources with limited user administration. Member roles have read and basic write access to assigned resources only. Each role tier has progressively restricted capabilities aligned to typical content, user management, and audit workflows.

How do I protect FastAPI endpoints with role-based permissions?

Protect endpoints by attaching permission decorators that specify required roles, using endpoint dependencies to validate tokens and extract role claims, and implementing resource-level checks to ensure users can only modify their own or assigned resources. Test with tokens from users holding different roles to verify authorization behavior.

Can I use role-based access control with FastAPI middleware?

Yes, FastAPI middleware can enforce RBAC by intercepting requests, validating tokens, and attaching role information to the request context before it reaches endpoint handlers. This centralized approach applies role checks across all protected endpoints without repeating authorization logic in individual route handlers.

Do I need frontend role checks if I'm protecting FastAPI endpoints?

Frontend role checks improve user experience by hiding unauthorized UI elements, but backend endpoint protection is mandatory for security. Frontend hooks display or hide options based on roles, while backend decorators and middleware enforce actual access control and prevent unauthorized requests from succeeding.

What permissions should I check for public versus private resources?

Public resources require no role validation. Private resources enforce role-based access: admins access all resources, leads access team resources, members access only assigned content. Implement resource-level permission rules that check both the user's role and their ownership or assignment to the specific resource being accessed.