Authorization
Build secure access control with RBAC, ABAC, permissions, policies, and scope-based authorization.
by clawic★ 23 GitHub stars
Install Authorization in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
When to Use
User needs to control what actions users can perform. Agent handles permission design, role hierarchies, policy evaluation, and access control middleware.
Quick Reference
| Topic | File |
|---|---|
| RBAC vs ABAC comparison | models.md |
| Implementation patterns | patterns.md |
| Framework middleware | middleware.md |
Core Rules
1. Auth ≠ Authorization
- Authentication: Who you are (login, OAuth, tokens)
- Authorization: What you can do (permissions, roles, policies)
- Never mix concerns — auth happens BEFORE authorization
2. Principle of Least Privilege
- Default deny — explicit grants only
- Users get minimum permissions for their job
- Audit permissions periodically (revoke unused)
- Temporary elevation over permanent grants
3. Choose the Right Model
| Model | Best For | Complexity |
|---|---|---|
| ACL | Simple resource ownership | Low |
| RBAC | Organizational hierarchies | Medium |
| ABAC | Dynamic context-based rules | High |
| ReBAC | Social graphs, sharing | High |
Start simple → evolve when needed.
4. Role Design Patterns
- Roles represent jobs, not permissions
- Max 3 inheritance levels (admin → manager → user)
- Avoid role explosion — combine with ABAC for edge cases
- Document role definitions (what can this role DO?)
5. Permission Naming
resource:action:scope
documents:write:own ← Can edit own documents
documents:write:team ← Can edit team documents
documents:delete:all ← Can delete any document
Consistent naming prevents ambiguity.
6. Policy Evaluation Order
- Explicit deny → always wins
- Explicit allow → checked second
- No match → default deny
- Log all denials for debugging
7. Never Hardcode
// ❌ Bad — hardcoded role check
if (user.role === 'admin') { ... }
// ✅ Good — permission check
if (can(user, 'settings:update')) { ... }
Roles change. Permissions are stable.
Common Traps
- Checking roles instead of permissions → brittle when roles change
- OR logic in permissions → "can edit OR is admin" creates backdoors
- Caching permissions too long → stale grants after role changes
- Frontend-only checks → always verify server-side
- God roles → split "admin" into specific permission sets
- Circular inheritance → A inherits B inherits A crashes system
Security & Privacy
Data that stays local:
- All documentation and patterns are reference material
- No data collection or external requests
This skill does NOT:
- Access your codebase automatically
- Make network requests
- Store any user data
Feedback
- If useful, star it: https://clawic.com/skills/authorization
- Latest version: https://clawic.com/skills/authorization
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- _meta.json
- middleware.md
- models.md
- patterns.md
FAQ
What does the Authorization skill do?
Build secure access control with RBAC, ABAC, permissions, policies, and scope-based authorization.
How do I install the Authorization skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the Authorization skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…