Skip to main content
RBAC shield and padlock
OPEN SOURCE · TYPESCRIPT · NODE.JS

Access control,
without the complexity.

A precise, hierarchical authorization engine for teams building applications that need to grow. Model roles, express conditions, and ship with confidence.

TSJSMIT
Designed for developers. Ready for production.
permission-check.tsLIVE EXAMPLE
import { createRBAC } from '@rbac/core';

const rbac = createRBAC({
  enableLogger: false,
  roles: {
    viewer: { can: ['docs:read'] },
    editor: {
      inherits: ['viewer'],
      can: ['docs:edit']
    }
  }
});

await rbac.can('editor', 'docs:read');
// true — inherited permission
READY FOR REAL APPLICATIONSNode 22+ / ESM + CJS
01 / THE ENGINE

A small API. Remarkable flexibility.

Make authorization decisions in one place and keep your policy model readable as your application grows.

01 / 04

Hierarchical roles

Compose permissions through inheritance. Change roles at runtime.

02 / 04

Context-aware rules

Express precise checks with synchronous, async, and callback conditions.

03 / 04

Flexible matching

Use exact operations, wildcards, and regular-expression patterns.

04 / 04

Built for your stack

Integrate with Express, Fastify, NestJS, and optional database adapters.

02 / THE MODEL

Permissions flow through roles.

Parent roles grant capabilities to their descendants. Conditions let you narrow individual operations at request time.

Explore documentation
viewerdocuments:read
BASE
editordocuments:edit · when(owner)
EXTENDS VIEWER
admindocuments:*
EXTENDS EDITOR
03 / SEE IT WORK

Test a permission. See the result.

This example calls the same RBAC implementation used by the package. Try different roles and operations.

Try the playground
LIVE EXAMPLERBAC / v4
RESULT
await rbac.can(...)
● Decision returned by the real RBAC engine. Role matches below are explanatory hints, not an engine-generated decision trace.
04 / START BUILDING

From install to authorization in minutes.

One dependency. A clear API. Full TypeScript definitions.

Install with npm
$npm install @rbac/core
Designed for developers. Ready for production.

Fits into your stack

Works with Express, NestJS, Fastify, MongoDB, MySQL, and PostgreSQL through published integrations.

ExpressNestJSFastifyMongoDBPostgreSQLMySQL
RBAC / OPEN SOURCE

Build the rules. Keep the control.

Start with the basics, explore conditions, or inspect every public API in the reference.