register-permissionslisted
Install: claude install-skill singleton-sd/ai-plattform-skills
# Register Permissions
When implementing a **new Prisma model** or **guarded Nest route** in this
repo, register the matching `{resource}:{action}` in the permissions catalog.
Do not ship the route until the drift check is green.
Canonical checklist (commands, artifacts, deploy):
[`docs/permissions.md`](../../../docs/permissions.md).
AuthZ stays in the Permissions pillar (`Check(subject, action, resource)` →
OpenFGA). Coarse Entra roles (`@Roles`) stay in SingleSignOn. Do not embed
AuthZ rules in Contact/Tenant/etc.
## When this skill applies
Run it if **any** of these is true:
- New Prisma model / table that will be a guarded resource
- New or changed Nest controller method that `PermissionsGuard` should authorize
- New HTTP `METHOD` + Nest `route.path` that is not already in
`infra/openfga/permissions.manifest.json`
Skip when the change is docs-only, CI-only, or a public unauthenticated route
that is intentionally not in the catalog.
## Register
Dry-run first, then apply (from the repo root):
```bash
pnpm permissions:register -- --method PATCH --path /contacts/:id \
--action update --resourceType contact --resourceIdParam id
pnpm permissions:register -- --apply --method PATCH --path /contacts/:id \
--action update --resourceType contact --resourceIdParam id
```
`--path` must match Nest `route.path` (not the global `/api` prefix).
`--resourceIdParam` is the path param OpenFGA uses as the object id.
This updates both copies of `permissions.manifest.json`, ap