backend-resource-permissions

Official

Safely register new backend RBAC resources

Authorlety-ai
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Prevents unexpected 403 permission errors and inconsistent RBAC state by guiding developers through the complete process of registering a new resource across CASL, the auth database, and gateway decorators.

Core Features & Use Cases

  • Enum registration: Add the new resource to the TypeScript enum used by the auth database so database values and application enums match.
  • CASL mapping: Map the resource to its primary entity in CASL constants so PermissionsGuard can evaluate abilities correctly.
  • Auth DB migration & role assignments: Create an idempotent migration that extends the PostgreSQL enum, inserts the resource and four actions, and assigns role_permissions according to role limits.
  • Gateway integration: Register the migration and apply @Permissions decorators on controllers to protect endpoints.
  • Use Case: Use this when adding a new feature module, introducing a new entity type, or troubleshooting a 403 error for a missing resource.

Quick Start

Add the new resource by updating the TypeScript enum and CASL mapping, creating and registering an idempotent auth DB migration that inserts the resource and permissions and assigns role_permissions, and annotating gateway controllers with the appropriate @Permissions decorators.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: backend-resource-permissions
Download link: https://github.com/lety-ai/lety-skill-hub/archive/main.zip#backend-resource-permissions

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.