erify-authorization

Enforce AdminGuard and StudioGuard authorization patterns for erify_api endpoints.

1|Updated Jan 2, 2025
One-click install
npx skills add https://github.com/allenlin90/eridu-services --skill erify-authorization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erify-authorization
Source: https://github.com/allenlin90/eridu-services/tree/main/.agent/skills/erify-authorization
Command: npx skills add https://github.com/allenlin90/eridu-services --skill erify-authorization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterned authorization for erify_api to enforce isSystemAdmin bypass, StudioMembership validation, and planned RBAC references to secure admin and studio-scoped actions.

Core Features & Use Cases

  • AdminGuard integration with role-agnostic checks, by-explicit permission requirements
  • StudioProtected and StudioGuard to validate studio membership and roles
  • Scalable patterns for multi-scope access (system-wide, studio, client)
  • Guidance on future enhancements like JSONB roles and permissions

Quick Start

Configure AdminGuard and decorators in NestJS controllers to enforce studio-scoped permissions for new endpoints.

Frequently Asked Questions about erify-authorization

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

FAQPage Schema
How do I enforce studio-scoped authorization in a NestJS backend?

NestJS backend authorization is enforced by applying AdminGuard and @AdminProtected decorators to restrict endpoint access based on isSystemAdmin bypass and StudioMembership validation.

What is the best way to bypass permission checks for system admins in NestJS?

System admin bypass in NestJS is best handled by checking the isSystemAdmin flag within AdminGuard, allowing role-agnostic superuser access without embedding permissions directly in the JWT payload.

How do I validate studio membership for protected routes in a NestJS API?

Studio membership validation for protected API routes is implemented using StudioGuard to verify user association with the target studio before granting access to studio-scoped endpoints.

Can I use JSONB roles and permissions for RBAC in NestJS?

JSONB roles and permissions can be used for future RBAC integration in NestJS, extending the current role-agnostic AdminGuard pattern to support detailed, permission-based access control.

Does erify-authorization work with JWT-based authentication in NestJS?

erify-authorization works alongside JWT authentication in NestJS but deliberately avoids embedding permissions in the JWT token, relying instead on database-backed membership and admin checks.

How do I configure AdminGuard for multi-scope access control in NestJS?

AdminGuard for multi-scope access control in NestJS is configured by combining system-wide, studio, and client scope checks using explicit permission requirements and membership-driven authorization patterns.