ai-agent

nestjs-rbac

Awesome RBAC for NestJs
508 stars39 forksTypeScriptUpdated 5/21/2026100% free · open source
What it does

Provides a simple, declarative role‑based access control (RBAC) layer you can drop into any NestJS app.

When to use it
  • •You need to protect API endpoints based on user roles and permissions.
  • •Your team wants a single source of truth for roles that can be loaded from a DB or static file.
  • •You already use NestJS guards/decorators and want a ready‑made RBAC guard instead of writing one from scratch.
Ready-to-paste prompt
curl -H "Authorization: Bearer <jwt>" http://localhost:3000/users/123   # will be allowed only if the JWT's user has the 'admin' role or the 'read:profile' permission defined in your RoleProvider
Heads up: The library relies on NestJS's `ReflectMetadata` API; you must enable `emitDecoratorMetadata` and `experimentalDecorators` in `tsconfig.json`, and use NestJS v9+ (the guard throws if the framework version is lower).
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

✅ Light setup

Installs with a command or two; your AI agent can do it for you.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/nestjs-rbac && curl -fsSL https://workflowstacks.com/api/skills/nestjs-rbac/claude-skill -o ~/.claude/skills/nestjs-rbac/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How nestjs-rbac works
Codeflow
Free to inspect

Nestjs-rbac is a small TypeScript project (~650 lines across 24 code files, plus 17 test files). Setup is light: installs like a normal app. Reading the code is optional. Last commit 5 months ago, Other license, has a test suite.

Size
Small codebase
~650 lines · 24 code files · 5 min skim
Setup
One-command install
Installs like a normal app. Reading the code is optional.
Runs on
Node.js · Docker
No API keys detected
TypeScript 98%JavaScript 2%
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    AGENTS.md
    The instructions the AI actually follows
  3. 3
    index.js
    Where the program starts running
  4. 4
    package.json
    Dependencies and the commands it exposes
  5. 5
    src/index.ts
    Inside src/ — the main logic begins here
What's in each folder
src/Core code — the actual logic20 files
docker/Deployment / infrastructure1 files
test/Tests — proof it works20 files
.github/CI / automation (GitHub Actions)2 files
READMEHas testsDocumentedCI checksDocker readyOther licenseUpdated 5 mo ago
Quick Actions
Details
Creator
sergey-telpuk
Language
TypeScript
Category
ai-agent
Published
9/10/2019

Are you the creator of this tool? and earn 85% of every sale.

Show it off in your README:

Featured on WorkflowStacks
[![Featured on WorkflowStacks](https://workflowstacks.com/api/badge/nestjs-rbac.svg)](https://workflowstacks.com/skills/nestjs-rbac?utm_source=github&utm_medium=badge)
🔥 Hot this week, in your inbox
Skills like this, every Monday.

The five fastest-growing open-source AI skills, ranked by GitHub star growth. One email a week, unsubscribe anytime.