Skip to content
Back to skills

Authorization

ASecurity

Build secure access control with RBAC, ABAC, permissions, policies, and scope-based authorization.

  • 17 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 29, 2026
securityjavascriptgojavadebuggingfrontendsecuritydocumentation

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned May 29, 2026

npx -y skills add clawic/skills --skill authorization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Authorization?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Authorization
[![Security: A โ€” Skills Directory](https://www.skillsdirectory.com/api/skills/clawic-authorization/badge)](https://www.skillsdirectory.com/skills/clawic-authorization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Authorization
slug: authorization
version: 1.0.0
homepage: https://clawic.com/skills/authorization
description: Build secure access control with RBAC, ABAC, permissions, policies, and scope-based authorization.
metadata: {"clawdbot":{"emoji":"๐Ÿ”","requires":{"bins":[]},"os":["linux","darwin","win32"]}}
---

## 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
1. Explicit deny โ†’ always wins
2. Explicit allow โ†’ checked second
3. No match โ†’ default deny
4. Log all denials for debugging

### 7. Never Hardcode
```javascript
// โŒ 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: `clawhub star authorization`
- Stay updated: `clawhub sync`

Files in this skill

  • SKILL.md3 KB
  • _meta.json178 B
  • middleware.md5.5 KB
  • models.md2.8 KB
  • patterns.md4.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading commentsโ€ฆ

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.