Lightweight & Simple Access Control
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.
- 🔒 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.
Bash
$npm install rolebaker
Click to copy
export const { hashPermission } =
bakeAuthorization<...>(...)