Skip to content
Agentmart
Submit a tool

advanced-rbac

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

Skill by jyjeanne

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jyjeanne-advanced-rbac

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/advanced-rbac

What's inside

Skill name
advanced-rbac
Description
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.
License
MIT
Instructions
59 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## 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.

From jyjeanne/ai-setup-forge, MIT.

More from jyjeanne/ai-setup-forge

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Mar 16, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jyjeanne

Cite this page

advanced-rbac skill. Agent Mart. https://agentmart.dev/skills/jyjeanne-advanced-rbac (last updated 2026-10-24)