templates-module-rbac

Enforce role-based and ownership access controls across multi-route backend modules.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/ivegamsft/work-tracker --skill templates-module-rbac
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: templates-module-rbac
Source: https://github.com/ivegamsft/work-tracker/tree/main/.squad/skills/templates-module-rbac
Command: npx skills add https://github.com/ivegamsft/work-tracker --skill templates-module-rbac

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

The Templates module RBAC pattern solves the problem of enforcing complex and mixed Role-Based Access Control (RBAC) rules across a backend module with multiple route prefixes.

Core Features & Use Cases

  • Multi-route RBAC: Facilitates role-gated and ownership-based security checks across multiple related endpoints.
  • Ownership Checks: Ensures that endpoints requiring user ownership can only be accessed by the owner of the associated data.
  • Status Computation: Centralizes status calculation logic to maintain consistent state management across the module.
  • Reference: For detailed guidance and implementation examples, refer to the associated apps/api/src/modules/templates/{router,service}.ts.

Quick Start

To utilize the RBAC pattern in the Templates module, import the dedicated router and service, pass an { id, role } actor object, and integrate the logic into your application flow.

Frequently Asked Questions about templates-module-rbac

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

FAQPage Schema
How do I enforce role-based access control across multiple backend route prefixes?

Role-based access control across multiple backend route prefixes is enforced by centralizing security rules in a shared service layer. This pattern handles role-gated checks and ownership validation to secure related endpoints consistently.

What is the best way to handle ownership checks for user data in a multi-route module?

Ownership checks for user data in a multi-route module are handled by verifying the actor's identity against the data owner before granting access. This ensures endpoints requiring user ownership can only be accessed by the associated data owner.

How do I centralize status computation logic across multiple endpoints?

Centralizing status computation logic across multiple endpoints is achieved by moving the calculations into a shared service layer. This maintains consistent state management and enforces complex security rules across the entire backend module.

Can I use this RBAC pattern for complex security rules in a service-layer shared backend?

Yes, you can use this RBAC pattern for a service-layer shared backend. It is intended specifically for applications where complex security rules across multiple endpoints are a requirement, handling both role-gated and ownership-based checks.

How do I pass actor information to secure backend endpoints?

To secure backend endpoints, you pass an actor object containing the user's ID and role to the dedicated router and service. This allows the system to perform fine-grained access control and verify data ownership.

When do I need mixed RBAC rules for backend security?

Mixed RBAC rules for backend security are needed when a module has multiple route prefixes requiring both role-based gating and strict ownership validation. This pattern solves the problem of enforcing complex, mixed access rules across related endpoints.