add-permission

Add permission constants to C# and TypeScript files for authorization rules.

230|29|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/fpindej/netrock --skill add-permission
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-permission
Source: https://github.com/fpindej/netrock/tree/main/.claude/skills/add-permission
Command: npx skills add https://github.com/fpindej/netrock --skill add-permission

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the process of adding new permissions to both the backend and frontend of an application, ensuring consistency and reducing manual errors.

Core Features & Use Cases

  • Backend Integration: Adds constants to C# permission files and applies them to controller actions.
  • Frontend Integration: Creates corresponding constants in TypeScript and integrates them into UI components and routing guards.
  • Use Case: When a new feature like "Order Management" is introduced, this Skill helps define and implement the necessary orders.view and orders.manage permissions across the entire application stack.

Quick Start

Add the 'orders.view' permission to the application by following the backend and frontend steps outlined in the skill documentation.

Frequently Asked Questions about add-permission

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

FAQPage Schema
How do I add new permissions to both frontend and backend code consistently?

To add permissions consistently, define constants in both backend C# files like AppPermissions.cs and frontend TypeScript files like permissions.ts. This ensures authorization rules are synchronized across controller actions, UI components, and routing guards.

What is the best way to manage authorization constants across C# and TypeScript?

Managing authorization constants across C# and TypeScript involves defining them in dedicated files such as AppPermissions.cs and permissions.ts. This approach ensures that both backend controller actions and frontend routing guards reference the same permission keys.

How do I integrate new authorization rules into UI components and routing guards?

Integrate new authorization rules into UI components and routing guards by creating corresponding TypeScript constants in permissions.ts. These constants allow the frontend to check user access levels before rendering elements or allowing route activation.

Can I seed roles when defining new permission constants in the backend?

Yes, you can optionally seed roles when defining new permission constants in the backend. This facilitates the integration of new authorization rules by automatically assigning the newly created permissions to specific roles during database initialization.

How do I apply permission constants to controller actions in C#?

Apply permission constants to controller actions in C# by referencing the newly added definitions in AppPermissions.cs. This binds the authorization rules to specific endpoints, ensuring that only users with the correct permissions can access the actions.

Why define separate permission files for frontend and backend instead of a shared file?

Defining separate permission files for frontend and backend is necessary due to language differences between C# and TypeScript. Maintaining parallel files like AppPermissions.cs and permissions.ts ensures type safety and consistency across the entire application stack.