{"repo":"phellipeandrade/rbac","free":true,"listed":false,"github":"https://github.com/phellipeandrade/rbac","clone":"git clone https://github.com/phellipeandrade/rbac.git","description":"Hierarchical Role-Based Access Control for Node.js","language":"TypeScript","stars":283,"topics":["rbac","authorization","hierarchical","role","security","permissions","acl","javascript","nodejs","express"],"license":"MIT","category":"security-tools","readme_excerpt":"Hierarchical Role-Based Access Control for Node.js ⏱ Lightweight ⚡️Fastest RBAC (check benchmarks) ️🍃low dependency Features Focused on operations Scalable Each role is given specific access rights for every operation High granularity in assigning rights Wildcard and regex support for operations Optional database adapters (MongoDB, MySQL, PostgreSQL) Express, NestJS and Fastify middlewares Roles can be updated at runtime Thanks This project now uses Vite to generate the bundled output Thanks to Karl Düüna (DeadAlready) and his awesome post on medium Getting Started Install yarn add @rbac/rbac or npm install @rbac/rbac This library is written in TypeScript and the published package ships with its declaration files for a great developer experience. Import The package supports both ES modules and CommonJS. ES Modules (recommended) CommonJS Usage RBAC is a curried function thats initially takes an object with configurations, then returns another function that takes an object with roles, finally returns an object that holds \"can\" property that is a function. You can use it in many ways, below is one of them: Setup RBAC config Property Type Params Default Description -------------- --------------- ------------------------------------------------------------- --------------- ----------------------------------------- logger Function role: String operation: String result: Boolean colorsEnabled: Boolean (optional) defaultLogger Function that logs operations to console enableLogger Boo","default_branch":null,"files":null,"tree":[],"storefront":"/r/phellipeandrade","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/phellipeandrade/rbac/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}