Lewati ke konten utama

Casbin

An authorization library that supports access control models like ACL, RBAC, ABAC, ReBAC, BLP, Biba, LBAC, UCON, Priority, RESTful for Golang, Java, C/C++, Node.js, Javascript, PHP, Laravel, Python, .NET (C#), Delphi, Rust, Ruby, Swift (Objective-C), Lua (OpenResty), Dart (Flutter) and Elixir

Memulai
[object Object]

Model kontrol akses hibrida

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]

Penyimpanan kebijakan yang fleksibel

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 adaptor.

[object Object]

Antar-bahasa & antar-platform

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.

Permanensi Kebijakan

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: adaptor.
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 manajer-peran.
Role manager

Siapa yang menggunakan 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, lihat aplikasi ini!