add-authorization-methods

Add entity-specific authorization methods to an AuthorizationService for access control.

1|Updated May 21, 2025
One-click install
npx skills add https://github.com/madooei/backend-template --skill add-authorization-methods
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-authorization-methods
Source: https://github.com/madooei/backend-template/tree/main/.claude/skills/add-authorization-methods
Command: npx skills add https://github.com/madooei/backend-template --skill add-authorization-methods

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates and enforces consistent authorization checks in the service layer by adding entity-specific methods to an AuthorizationService.

Core Features & Use Cases

  • Adds canView{Entity}, canCreate{Entity}, canUpdate{Entity}, canDelete{Entity}, and canReceive{Entity}Event methods
  • Works with owner-admin patterns and optional SSE event routing
  • Integrates after resource service creation to ensure proper permissions across entities

Quick Start

Add the new entity's authorization methods to the AuthorizationService to enforce access control.

Frequently Asked Questions about add-authorization-methods

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

FAQPage Schema
How do I add entity-specific authorization methods to a backend service?

You add entity-specific authorization methods by implementing canView, canCreate, canUpdate, canDelete, and canReceive{Entity}Event checks within an AuthorizationService to enforce backend access control.

What is the ownership pattern for backend permissions in TypeScript?

The ownership pattern for backend permissions involves implementing admin and owner checks within your authorization methods to determine if a user can access or modify specific entity resources.

Do I need to update the events router for SSE when adding authorization?

Yes, you need to update the events router when adding authorization if your backend uses Server-Sent Events, ensuring the canReceive{Entity}Event method properly filters SSE event delivery.

When should I integrate authorization methods after creating a resource service?

You should integrate authorization methods immediately after creating a resource service to ensure proper permissions are enforced across all entities before any access control vulnerabilities can occur.

Can I use TypeScript to enforce access control with admin and owner checks?

Yes, you can use TypeScript to enforce access control by importing entity types and implementing admin and owner checks directly within your AuthorizationService methods.