jyjeanne/ai-setup-forge/advanced-rbac

Claude Code and agent skill by jyjeanne/ai-setup-forge

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

To implement a scalable permission system where users have roles, and roles have granular permissions. Use when: B2B SaaS applications (Admin, Editor, Viewer); Systems with complex access requirements.

Install

npx vskill@latest install jyjeanne/ai-setup-forge/advanced-rbac

SKILL.md

The same SKILL.md was published earlier as jyjeanne/ai-setup-forge/advanced-rbac.

Purpose

To implement a scalable permission system where users have roles, and roles have granular permissions.

When to Use

  • B2B SaaS applications (Admin, Editor, Viewer).
  • Systems with complex access requirements.

Procedure

1. Data Model
  • Users: id, name, role_id (or m:n user_roles).
  • Roles: id, name (e.g., 'admin', 'editor').
  • Permissions: id, action, resource (e.g., create:post, read:user).
  • RolePermissions: Join table.
2. Middleware (Enforcement)

Don't check roles (if user.role === 'admin'). Check permissions.

javascript
// middleware/authorize.js
const authorize = (requiredPermission) => {
return async (req, res, next) => {
const userPermissions = await getUserPermissions(req.user.id); // Cached in JWT or Redis
if (!userPermissions.includes(requiredPermission)) {
return res.status(403).json({ error: 'Forbidden' });
}
next();
};
};
// usage
app.post('/posts', authorize('create:post'), createPost);
3. Hierarchy (Optional)

Roles can inherit from others.

  • Admin has all permissions of Editor + delete:user.
  • This logic is handled in the permission resolution function.
4. Frontend Integration

Send permissions list to frontend on login.

javascript
{
token: "...",
user: {
id: 1,
permissions: ["read:posts", "create:posts"]
}
}

Use a <Can permission="create:posts"> component to hide/show UI elements.

Constraints

  • Granularity: Balance between too broad (manage:all) and too specific (update:post:title).
  • Caching: Fetching permissions on every request is slow. Cache them in the JWT or Redis (invalidate on role change).

Expected Output

A flexible security model allowing admins to configure what users can do without changing code.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
8

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jyjeanne/ai-setup-forge/advanced-rbac/badge)](https://verified-skill.com/skills/jyjeanne/ai-setup-forge/advanced-rbac)

Something wrong with this skill or its page? Tell us.