Перейти к основному контенту

Casbin

An authorization library that supports access control models like ACL, RBAC, ABAC, ReBAC, PBAC, OrBAC, 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

Как начать
[object Object]

Модели контроля гибридного доступа

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]

Гибкое хранение политики

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 адаптеры.

[object Object]

Межязыковые и кросс-платформенные

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.

Сохранение политики

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: адаптеры.
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 ролевые менеджеры.
Role manager

Кто использует 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, проверить эти приложения!