Apache Casbin is an authorization library that enforces policies from configurable access-control models. It began in Go with ports across many languages and middleware integrations.
Overview
Apache Casbin is an open-source access control library focused on authorization enforcement. It supports multiple access models including ACL, RBAC, ABAC, and combinations such as RBAC with domains, deny-override rules, and prioritized policies.
Authorization logic is defined through PERM-style model configuration files plus policy rules, so teams can switch or extend models without rewriting application code. Features include policy management APIs, persistence adapters, consistency across nodes, enforcer pooling, and role managers.
The project ships production-ready implementations in many languages and documents middleware for common web frameworks, examples, benchmarks, and tutorials. An online policy editor helps author Casbin policies interactively.
Casbin is suited for embedding fine-grained permission checks into services, whether enforcing simple resource lists or tenant-aware role assignments.
Key features
- ACL, RBAC, and ABAC models
- CONF-based PERM model definitions
- Deny-override and priority rules
- Multi-language enforcer ports
- Policy persistence adapters
- Distributed policy consistency helpers
- Framework middleware integrations
- Online policy editor
Use cases
- API authorization middleware
- Multi-tenant RBAC enforcement
- Attribute-based access policies
- Centralized permission rule storage
- Microservice authz checks