create-custom-permissions

Adds named boolean capability flags to DaaS-backed Next.js applications via policy JSONB columns.

Updated May 27, 2026
One-click install
npx skills add https://github.com/Rkaaaa404/cyberhack-SYDT --skill create-custom-permissions-rkaaaa404
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-custom-permissions
Source: https://github.com/Rkaaaa404/cyberhack-SYDT/tree/main/.agents/skills/create-custom-permissions
Command: npx skills add https://github.com/Rkaaaa404/cyberhack-SYDT --skill create-custom-permissions-rkaaaa404

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Applications often need feature-level capability flags (e.g., "can reject leave requests", "can see a dashboard widget") that are not tied to any collection or CRUD operation. This Skill adds such custom permissions to a DaaS-backed app so they share the existing Policy → Role → User assignment chain and can be enforced in both React components and Next.js API routes. ## Core Features & Use Cases - Schema Extension via MCP: Adds a custom_permissions JSONB column to daas_policies using the DaaS MCP fields tool, with no SQL migration or DaaS code change required. - Server & Client Enforcement: Provides getCustomPermissions, hasCustomPermission, and enforceCustomPermission server utilities plus useCustomPermission React hooks, with admin bypass and OR-merge semantics across policies. - Policy Editor UI: Ships a CustomPermissionsEditor component that validates dot-notation keys and persists flags via PATCH /api/policies/:id. - Use Case: An admin wants only certain roles to reject leave requests. Create the key MyApp.LeaveRequest.Reject, assign it to the appropriate policy, guard the API route with enforceCustomPermission, and hide the Reject button with useCustomPermission. ## Quick Start Ask the AI to add a custom permission key such as "MyApp.Dashboard.TaskWidget" and assign it to the desired policies and roles in the DaaS-backed application.

Frequently Asked Questions about create-custom-permissions

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

FAQPage Schema
How do I add custom feature permissions to a DaaS application?▼

Add a custom_permissions JSONB column to daas_policies using the DaaS MCP fields tool, then store flags like "MyApp.Feature.Key": true. Flags merge across all of a user's policies with boolean OR and are checkable from server utilities and React hooks.

How do I enforce a custom permission in a Next.js API route?▼

Call enforceCustomPermission('MyApp.Domain.Capability') at the start of the route handler. It throws a 403 PermissionError when the flag is not true for the current user, and it must run in a Server Component or API route, never a Client Component.

Can I check custom permissions in React components?▼

Yes, use the useCustomPermission(key) hook from the extended PermissionsContext to conditionally render widgets or buttons. These client checks are UX only; the API route enforcement remains the actual security boundary.

Do admin users bypass custom permission checks?▼

Yes, users with any policy granting admin_access: true receive true for all custom permission keys, consistent with collection permission behavior. Only admin-access users can write to daas_policies, preventing privilege escalation.

What naming convention should custom permission keys follow?▼

Keys must use dot-notation with at least three PascalCase segments: AppName.Domain.Capability, such as MyApp.LeaveRequest.Reject. The DaaS.* namespace is reserved by the platform and must not be used.