# apache/casbin-rs

An authorization library that supports access control models like ACL, RBAC, ABAC in Rust

Repository: https://github.com/apache/casbin-rs
Canonical: https://ross.abutalabs.com/products/casbin-rs
Homepage: https://casbin.org
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: casbin, rust, access-control, authorization, rbac, abac, acl, auth, authz, permission
Last push: 2026-08-13T06:03:25+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 69, longevity 100
- inputs: {"age_days": 2576, "days_push": 20, "days_rel": 210, "gap_med": 8.5, "n_releases_24m": 19}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1134, forks 94 (observed 2026-08-28T04:03:43.201698+00:00)

## What it is
Casbin-RS is the Rust implementation of Apache Casbin, an authorization library that enforces access control based on configurable models such as ACL, RBAC, and ABAC. Policies are defined in PERM metamodel configuration files and can be persisted via adapters to files or databases like MySQL, PostgreSQL, and MongoDB.

## Use cases
- enforce role-based access control in a Rust web service
- implement ACL permissions for API endpoints
- add attribute-based access control (ABAC) to an application
- store authorization policies in a database
- manage role hierarchies and user-role mappings
- switch authorization models without rewriting code

## When to choose
- you need flexible, model-driven authorization in a Rust project
- you want consistent authorization logic across multiple languages via the Casbin ecosystem
- you need RBAC with role hierarchies, domains, or ABAC conditions
- you want policies persisted in files or various SQL/NoSQL databases

## When to avoid
- you need a full identity provider with authentication, SSO, or user management
- your authorization needs are trivial and a simple hardcoded check suffices
- you require fine-grained ReBAC-style relationship graphs like a dedicated Zanzibar system

## Facets
- artifact type: library
- maturity: active
- function: authorization, auth, middleware
- domain: security, backend, web-development, developer-tools
- platform: rust, cross-platform
- tags: rbac, abac, acl, access-control, casbin, policy-enforcement, permissions

## Member repositories
- apache/casbin-rs (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:43.201698+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:36:54.179724+00:00, confidence not recorded.
  - readme: https://github.com/apache/casbin-rs (fetched 2026-08-28T04:03:43.201698+00:00, sha ae7aa7e7c88c)
  - homepage: https://casbin.org (fetched 2026-08-29T12:41:57.065316+00:00, sha bf9a21b944e9)
  - site_page: https://casbin.apache.org/docs/overview (fetched 2026-08-29T12:41:57.074509+00:00, sha e6df9330fc66)
  - site_page: https://casbin.apache.org/docs/downloads (fetched 2026-08-29T12:41:57.076705+00:00, sha 34577d2c2ff2)
  - site_page: https://casbin.apache.org/docs/get-started (fetched 2026-08-29T12:41:57.078823+00:00, sha 1cef184398ca)
  - site_page: https://casbin.apache.org/docs/category/access-control-models (fetched 2026-08-29T12:41:57.081588+00:00, sha 323b2c9c0a23)
  - site_page: https://casbin.apache.org/docs/category/storage (fetched 2026-08-29T12:41:57.084180+00:00, sha 36570671a14a)
  - site_page: https://casbin.apache.org/docs/adapters (fetched 2026-08-29T12:41:57.085910+00:00, sha cd140120068d)
  - site_page: https://casbin.apache.org/docs/category/api (fetched 2026-08-29T12:41:57.088112+00:00, sha 4099ba1bb75f)
  - site_page: https://casbin.apache.org/docs/ide-plugins (fetched 2026-08-29T12:41:57.089734+00:00, sha 5a9e92f4f45a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
