Pular para o conteúdo principal
NEWCasbin v3.4.1 Released

Open-source authorization for
applications

A powerful and efficient open-source access control library that supports various access control models for enforcing authorization across the board

Use Casbin with Multiple Languages

Golang
Java
C/C++
Node.js
Front-end JavaScript
PHP
Laravel
Python
.NET (C#)
Delphi
Rust
Ruby
Swift (Objective-C)
Lua (OpenResty, Kong, APISIX)
Dart (Flutter)
Elixir
Cloud Native (Kubernetes, Istio, Envoy, KubeSphere)
[object Object]

Modelos híbridos de controle de acesso

Casbin abstracts access control models into CONF files based on the PERM metamodel (Policy, Effect, Request, Matchers). Switching or upgrading your project's authorization mechanism is as simple as modifying a configuration file.

[object Object]

Armazenamento de política flexível

Casbin policies can be stored in memory, files, or numerous databases. We currently support dozens of storage backends including MySQL, Postgres, Oracle, MongoDB, Redis, Cassandra, and AWS S3. View the complete list of supported adaptadores.

[object Object]

Multi-idiomas & multi-plataformas

Casbin is available in multiple programming languages including Golang, Java, PHP, Node.js, Python, .NET, Rust, and more. All implementations share a consistent API and behavior, allowing you to learn once and use everywhere.

Try Casbin Online Editor

Write and test your Casbin model and policy in real-time with our interactive online editor. Experiment with different access control models and see results instantly.

Persistência de Política

Casbin implements policy storage through adapters (middleware components). To maintain a lightweight core, adapter code is not included in the main library (except for the default file adapter). We welcome third-party adapter contributions. For a complete list of available adapters and detailed documentation, please refer to: adaptadores.
Policy Persistence
Policy enforcement at scale

Policy Enforcement at Scale

Some adapters support filtered policy management, meaning Casbin loads only a subset of policies from storage based on specified filters. This enables efficient policy enforcement in large, multi-tenant environments where loading the entire policy set would create a performance bottleneck.

Role Manager

The role manager handles RBAC role hierarchies (user-role mappings) in Casbin. It can retrieve role data from Casbin policy rules or external sources such as LDAP, Okta, Auth0, Azure AD, and others. We support multiple role manager implementations. To maintain a lightweight core, role manager code is not included in the main library (except for the default implementation). View the complete list of available gerenciadores-de-funções.
Role manager

Quem está usando o Casbin?

Hundreds of projects use Casbin, from established Fortune 500 companies to innovative startups. If you're curious to see what can be accomplished with Casbin, confira esses aplicativos!