Apache Casbin
Open-source authorization for applications
A powerful and efficient open-source access control library that supports multiple authorization models
![[object Object]](/img/model.png)
Modelos híbridos de controle de acesso
Apache Casbin uses CONF files to define access control models based on the PERM metamodel (Policy, Effect, Request, Matchers). You can change or upgrade your authorization mechanism by modifying the configuration file.
![[object Object]](/img/storage.png)
Armazenamento de política flexível
Apache Casbin policies can be stored in memory, files, or databases. We support dozens of storage backends including MySQL, Postgres, Oracle, MongoDB, Redis, Cassandra, and AWS S3. See the full list of adaptadores.
![[object Object]](/img/language.png)
Multi-idiomas & multi-plataformas
Apache Casbin is implemented in multiple languages including Golang, Java, PHP, Node.js, Python, .NET, Rust, and more. All implementations share the same API and behavior.
Try the Apache Casbin Online Editor
Write and test your Apache Casbin model and policy in real-time with the interactive online editor. Try different access control models and see results instantly.
Persistência de Política
Apache Casbin stores policies through adapters. To keep the library lightweight, adapter code is separated from the main library (except for the default file adapter). We support third-party adapter contributions. See the full list of adaptadores for more information.

Policy Enforcement at Scale
Some adapters support filtered policy loading. This means Apache Casbin can load only a subset of policies from storage based on specified filters. This feature is useful for large-scale, multi-tenant applications where loading all policies at once would be inefficient.Role Manager
The role manager handles RBAC role hierarchy (user-role mappings) in Apache Casbin. It can load role data from Apache Casbin policy rules or from external sources like LDAP, Okta, Auth0, Azure AD, etc. To keep the library lightweight, role manager code is separated from the main library (except for the default one). See all available gerenciadores-de-funções.
Who's using Apache Casbin?
Hundreds of projects use Apache Casbin, from Fortune 500 companies to new startups. If you want to see what can be built with Apache Casbin, confira esses aplicativos!



























