new-permission

Add RBAC permission variants to the Permission enum with TypeScript bindings.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-permission
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-permission
Source: https://github.com/weiloon1234/Forge-Starter/tree/main/.claude/skills/new-permission
Command: npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-permission

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Introducing a new RBAC scope requires extending the Permission enum, updating its keys, and wiring downstream checks across backend and frontend. This Skill provides a standardized pattern to add a new variant, keep type-safe mappings, and ensure governance over access controls.

Core Features & Use Cases

  • Enum extension: adds a new <module>.<action> variant to the Permission enum and its corresponding Rust and TypeScript bindings.
  • Downstream wiring: updates module/action and implied permission relationships, ensuring read -> manage semantics are preserved.
  • End-to-end integration: coordinates updates to routes, admin datatables, and frontend gating with generated types and tests.

Quick Start

Add a new permission variant to the Permission enum and update downstream wiring (keys, module, action, and implied relationships) accordingly.

Frequently Asked Questions about new-permission

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

FAQPage Schema
How do I add a new RBAC permission variant to a Rust enum and TypeScript frontend?

To add a new RBAC permission variant, you extend the Permission enum with a new module/action pair scope and update its TypeScript bindings. This requires modifying key_str(), module(), action(), and implied_permission() mappings to keep type-safe relationships intact.

What is the correct way to wire implied permissions for a new RBAC scope?

Wiring implied permissions for a new RBAC scope involves updating the implied_permission() mapping to preserve read-to-manage semantics. This ensures that granting a manage permission automatically implies the corresponding read permission across both backend checks and frontend UI gating.

How do I keep TypeScript permission types in sync with a Rust Permission enum?

To keep TypeScript permission types in sync with a Rust Permission enum, you regenerate frontend types after modifying the backend enum. This is validated by running cargo test and make types to ensure the generated TypeScript bindings match the updated Rust variants.

Do I need to run cargo test and make types after extending an RBAC permission enum?

Yes, you need to run cargo test and make types after extending an RBAC permission enum. These commands validate that the new variant's key_str(), module(), and action() mappings are correct and that the regenerated TypeScript frontend bindings are fully synchronized.

What downstream components need updating when introducing a new RBAC module and action pair?

Introducing a new RBAC module and action pair requires updating downstream routes, admin datatables, and frontend UI gating components. This end-to-end integration ensures access controls are consistently enforced across backend API checks and frontend user interfaces.

Can I use this approach to add a topups.read permission scope without breaking existing access controls?

Yes, you can safely add a topups.read permission scope by following the standardized enum extension pattern. By updating the implied_permission() mappings and validating with cargo test, you ensure existing access controls and type-safe frontend bindings remain unbroken.