An open API service indexing awesome lists of open source software.

https://github.com/tkachenko0/rolebaker

TypeScript-safe and framework-agnostic, Attribute-Based Access Control library for managing permissions with effortless documentation generation.
https://github.com/tkachenko0/rolebaker

abac access access-control auth authorization permissions rbac role-based-access-control

Last synced: 3 months ago
JSON representation

TypeScript-safe and framework-agnostic, Attribute-Based Access Control library for managing permissions with effortless documentation generation.

Awesome Lists containing this project

README

          

# RoleBaker

I’ve spent countless hours digging through code, tracing permissions, and trying to figure out who can do what, only to end up frustrated. That’s why I built this library, to take the guesswork out of access control by providing a structured way to define and enforce permissions while automatically generating clear documentation for role-based rules.

**RoleBaker** is a flexible library for handling **Attribute-Based Access Control (ABAC)** with type safety in a **framework-agnostic** way. It simplifies managing user permissions and generating automatic documentation, providing a clear and structured approach to handling user roles and resource actions.

## Pros

- **πŸ”’ Type-Safe Access Control** – Prevent runtime errors with strongly typed roles and actions.
- **πŸ“š Auto-Generated Documentation** – Easily generate clear documentation for roles and permissions.
- **🌍 Framework-Agnostic** – Works seamlessly with any JavaScript/TypeScript framework.
- **βš–οΈ Single & Multi-Role Support** – Supports both single-role users and multi-role configurations.
- **πŸ›‘οΈ Attribute-Based Access Control (ABAC)** – Define permissions based on roles and dynamic attributes.
- **πŸ”„ Flexible Permission Logic** – Supports both simple boolean checks and complex function-based rules.
- **βœ… Highly Tested** – Ensures reliability and stability with comprehensive test coverage.

---

## πŸ“¦ Installation

To install RoleBaker, you can use npm or yarn:

```bash
npm install rolebaker
```

or

```bash
yarn add rolebaker
```

---

## **πŸ“ Usage & Documentation**

Find usage examples for **single-role** and **multi-role** models in the official documentation:

πŸ”— [RoleBaker Documentation](https://role-baker.vercel.app/)

![Doc Image](./images/doc-image.png)

### **πŸ“– Framework-Specific Guides**

- **React** β†’ [Guide](https://role-baker.vercel.app/frameworks/react)
- **Angular** β†’ [Guide](https://role-baker.vercel.app/frameworks/angular)
- **Express** β†’ [Guide](https://role-baker.vercel.app/frameworks/express)
- **Other frameworks** β†’ [Guide](https://role-baker.vercel.app/frameworks/other)