apache/casbin

Apache Casbin: an authorization library that supports access control models like ACL, RBAC, ABAC.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 20 minutes ago
Added to GitGenius on June 28th, 2026
Created on April 8th, 2017
Open Issues & Pull Requests: 42 (+0)
Number of forks: 1,756
Total Stargazers: 20,322 (+0)
Total Subscribers: 237 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 0.0 hours
Mean response time: 2.3 days
90th percentile: 2.4 days
Tracked items: 167

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 31% of open issues come from outside the core team, a mix of external reports and the maintainers' own roadmap. Only 8% of issues opened in the past year have been closed. Three people close 94% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 32
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 369 days
Stale 30+ days: 29
Stale 90+ days: 27

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 1

Top labels

  • enhancement (67)
  • question (56)
  • bug (28)
  • invalid (9)
  • released (8)
  • wontfix (7)
  • help wanted (1)

Most active issues this week

Detailed Description

Apache Casbin is an open-source authorization library written in Go that enforces access control policies across applications. The library abstracts access control models into configuration files based on the PERM metamodel, which stands for Policy, Effect, Request, and Matchers. This design allows developers to switch or upgrade authorization mechanisms by simply modifying a configuration file rather than rewriting code.

The library supports multiple access control models including ACL (Access Control List), RBAC (Role-Based Access Control), and ABAC (Attribute-Based Access Control). Within these broad categories, Casbin provides specialized variants such as ACL with superuser support, RBAC with resource roles, RBAC with domains or tenants, RESTful access control with HTTP methods and path patterns, and deny-override authorization where deny rules take precedence over allow rules. The library also supports priority-based policy rules similar to firewall rule ordering.

Casbin's core functionality enforces policies in the classic subject-object-action form or custom forms defined by users. It handles storage of access control models and policies, manages role-user and role-role mappings for RBAC scenarios, supports built-in superuser roles, and includes multiple operators for rule matching such as keyMatch for pattern-based resource matching. The library explicitly does not handle authentication or manage user and role lists, as these are better managed by individual projects. It also does not function as a password container.

Casbin implementations exist across multiple programming languages including Java, Node.js, PHP, Python, .NET, C++, and Rust, all marked as production-ready. The project provides comprehensive tooling including a web-based online editor with syntax highlighting and code completion for writing models and policies, management APIs for runtime permission handling, RBAC-specific APIs for simplified code, and a web-based UI for model and policy management. The library also supports policy persistence through adapters and policy consistency across multiple nodes through watchers.

This cross-project involvement indicates the library's relevance across different technology ecosystems and its adoption by significant open-source initiatives.