permissions

Enforce consistent team-based permissions across client and server code.

2|2|Updated May 30, 2025
One-click install
npx skills add https://github.com/wodsmith/thewodapp --skill permissions-wodsmith
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: permissions
Source: https://github.com/wodsmith/thewodapp/tree/main/.claude/skills/permissions
Command: npx skills add https://github.com/wodsmith/thewodapp --skill permissions-wodsmith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Ensures client-side actions and server-side functions check the same permission and use the most appropriate granularity.

Core Features & Use Cases

  • Permission alignment: Use the same permission constant on client and server
  • Granular permissions: Prefer specific permissions like EDIT_COMPONENTS
  • Team context: All checks require a teamId
  • Validation patterns: Guidance for aligning checks across code

Quick Start

Use hasTeamPermission and requireTeamPermission to gate actions.

Frequently Asked Questions about permissions

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

FAQPage Schema
How do I enforce the same permissions on both client and server?▼

Permission alignment ensures client-side actions and server-side functions check identical permission constants. Use the same TEAM_PERMISSIONS constant on both sides with hasTeamPermission and requireTeamPermission to prevent authorization failures and maintain consistency across your application.

What's the difference between hasTeamPermission and requireTeamPermission?▼

hasTeamPermission checks if a user has a specific permission and returns a boolean, allowing conditional logic. requireTeamPermission throws an error if the permission is missing, halting execution. Choose requireTeamPermission for critical operations and hasTeamPermission for optional features.

Why do all permission checks require a teamId?▼

Team-based permissions isolate authorization to specific teams in multi-tenant systems. Including teamId in every check ensures users can only access resources within their assigned team, preventing cross-team data leaks and maintaining security boundaries.

How do I add permission checks to new features?▼

Identify the specific permission your feature needs from TEAM_PERMISSIONS constants. Call hasTeamPermission or requireTeamPermission with the permission and teamId on the client before dispatching actions, then repeat the same check on the server function to align validations.

Can I use granular permissions instead of broad ones?▼

Yes, granular permissions like EDIT_COMPONENTS are preferred over broad catch-all permissions. They provide fine-grained control over specific actions, reduce security surface area, and make authorization intent explicit in your codebase.

What happens if client and server permissions don't match?▼

Misaligned permissions cause authorization failures where users can trigger client-side actions that fail on the server. Use the same permission constant and validation pattern on both sides, and integrate with src/utils/team-auth.ts utilities to maintain consistency.