permissions-rbac

Implements permission checks, role matrices, and resource grants for org-scoped routes and services.

49|11|Updated Jul 31, 2026
One-click install
npx skills add https://github.com/vstorm-co/agenticos --skill permissions-rbac-vstorm-co
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: permissions-rbac
Source: https://github.com/vstorm-co/agenticos/tree/main/.claude/skills/permissions-rbac
Command: npx skills add https://github.com/vstorm-co/agenticos --skill permissions-rbac-vstorm-co

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Authorization bugs in multi-tenant platforms are costly: a route gate placed on a per-resource endpoint silently refuses users holding explicit grants, and listings can leak or hide shared rows. This Skill encodes the project's three-layer permission model so new routes, roles, and grants are wired correctly the first time. ## Core Features & Use Cases - Correct gate placement: Enforces the rule that require(...) dependencies belong on collection routes while per-resource routes delegate to resolve_access in the service layer. - Permission and role authoring: Guides adding entries to the Perm catalog, assigning scopes (none, own, shared, all) across the owner/admin/builder/operator/member/viewer matrix, and testing refusals cross-tenant. - Grant and listing semantics: Explains visible_resource_ids (None vs empty list), grant widening without promotion, and contexts with no subject such as API keys and embed sessions. - Use Case: When adding a new org-scoped endpoint like POST /agents/{id}/publish, use this Skill to decide there must be no route gate, implement the resolve_access check in the service, and write a test proving a Viewer with an edit grant succeeds while another tenant is refused. ## Quick Start Use the permissions-rbac skill to add a new agents:publish permission, wire it into the role matrix, and gate the correct routes.

Frequently Asked Questions about permissions-rbac

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

FAQPage Schema
How do I add a new permission to a FastAPI route?▼

Add the permission to the Perm catalog in app/core/permissions.py, assign it to roles in the matrix with a Scope if resource-scoped, then gate collection routes with dependencies=[Depends(require(Perm.X))]. Per-resource routes must not have route gates; the service calls resolve_access instead.

When should I use require() vs resolve_access for authorization?▼

Use require() as a route dependency only on collection routes like GET /agents or POST /agents. Use resolve_access inside the service for single-resource routes, because a role gate cannot see per-row grants and would wrongly refuse a Viewer holding an explicit edit grant.

Why is a user with an edit grant being refused access?▼

A require() gate on a per-resource route refuses the request before resolve_access can widen access via the grant. Remove the route gate and let the service check resolve_access, which computes effective access as the maximum of role scope and grant.

How do permission scopes like own, shared, and all work?▼

Scopes answer which rows a resource permission reaches: none reaches nothing, own reaches rows the member created, shared adds explicitly granted rows, and all reaches every row in the organization. Global permissions are binary and treated as Scope.ALL.

How does authorization work for API keys without a user?▼

Contexts with no subject, such as API keys, embed sessions, and channel runs, cannot hold grants, so scopes narrower than all resolve to nothing. visible_resource_ids returns an empty list for them, never None, preventing accidental org-wide visibility.