param087/saas-starter-skills/authorization-rbac
Claude Code and agent skill by param087/saas-starter-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when controlling what a user may do — implement role-based access control with a central permission map, server-side checks on every mutation, and a typed `can()` helper instead of scattered role string comparisons.
Install
npx vskill@latest install param087/saas-starter-skills/authorization-rbacSKILL.md
The same SKILL.md was published earlier as param087/saas-starter-skills/authorization-rbac.
Authorization (RBAC)
Overview
Authentication says who you are; authorization says what you may do. Avoid if (role === "admin") sprinkled everywhere — it drifts and leaks. Define a single permission matrix mapping roles to actions, expose one typed can(role, action) helper, and call it on the server before every mutation. When rules outgrow roles, graduate to resource-level checks (ownership) without changing call sites.
When to use
- Different roles (owner/admin/member) get different capabilities.
- Any mutation needs a "is this user allowed?" check.
- You're comparing role strings inline in handlers or components.
The pattern
Enforce in the action/handler, after resolving the tenant:
Beyond roles
- Resource ownership: "only the creator or an admin can edit" → check
row.createdBy === user.id || can(role, ...). - Keep the matrix data, not code paths — adding a permission is a one-line edit, fully typed by the
Actionunion. - Mirror in the UI with the same
can()to hide buttons — but the server check is the real gate.
Pitfalls
- Authorizing in the client only — hiding a button isn't security; the endpoint must check.
- Role checks scattered inline — they fall out of sync; centralize in the matrix.
- Confusing tenancy with RBAC —
multi-tenancyensures it's your org's data; RBAC ensures you're allowed to act on it. You need both. - Defaulting unknown actions to allow — default-deny (
?? false). - Forgetting ownership rules — role alone can't express "your own drafts"; add resource checks.
Hand-off
A typed can() / authorize() enforced on the server. Pair with data-access-layer (which still scopes by org) and surface allowed actions to the UI.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/authorization-rbac/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/param087/saas-starter-skills/authorization-rbac)