Casbin
Open-source authorization for
applications

A powerful and efficient open-source access control library that supports multiple authorization models

Key Features

Flexible Access Models

Define authorization models using CONF files with PERM metamodel. Easily modify or upgrade access control logic by updating configuration.

Multi-Storage Support

Store policies in memory, files, or databases. Supports 20+ backends including MySQL, PostgreSQL, Redis, and cloud storage. See full list of adapters.

Cross-Platform Libraries

Available in Golang, Java, Node.js, Python, .NET, Rust, and more. Consistent API across all implementations.

Policy Persistence

Lightweight core library with pluggable adapters for policy storage. Supports third-party adapter contributions.

Scalable Enforcement

Filtered policy loading for large-scale applications. Load only relevant policies to optimize performance in multi-tenant environments.

Role Management

Handle RBAC hierarchies and user-role mappings. Load from Casbin policies or external sources like LDAP, Okta, and Azure AD. See all available role managers.

Try the Casbin Online Editor
Write and test your Casbin model and policy in real-time with the interactive online editor. Try different access control models and see results instantly.

Who's using Casbin?

Hundreds of projects use Casbin, from Fortune 500 companies to new startups. Check out these apps!