# apache/casbin-Casbin.NET

An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)

Repository: https://github.com/apache/casbin-Casbin.NET
Canonical: https://ross.abutalabs.com/products/casbin-casbinnet
Homepage: https://casbin.org
Language: C#
License: Apache-2.0
License Family: permissive
Topics: casbin, access-control, authorization, rbac, abac, acl, auth, permission, dotnet, authz
Last push: 2026-08-15T14:45:47+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 89, longevity 100
- inputs: {"age_days": 2652, "days_push": 18, "days_rel": 78, "gap_med": 6, "n_releases_24m": 16}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1330, forks 128 (observed 2026-08-28T04:04:24.060531+00:00)

## What it is
Casbin.NET is the .NET (C#) implementation of Apache Casbin, an open-source authorization library that enforces access control via models such as ACL, RBAC, and ABAC defined in PERM metamodel configuration files. Policies can be stored in memory, files, or databases through adapters, and the API is shared across Casbin implementations in other languages.

## Use cases
- enforce role-based access control in a C# web app
- implement ABAC permission checks in .NET services
- store authorization policies in SQL Server or PostgreSQL
- manage user-role hierarchies with an RBAC API
- switch access control models by editing a config file
- add multi-tenant authorization with filtered policy loading

## When to choose
- you need flexible, model-driven authorization in a .NET/C# project
- you want consistent authorization logic across polyglot services using Casbin
- you need pluggable policy storage backends (SQL, ORM, files)

## When to avoid
- you only need simple hardcoded role checks with no policy flexibility
- your stack is not .NET and you don't need cross-language consistency
- you require features like batch API or filtered adapters not fully supported in C#

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

## Member repositories
- apache/casbin-Casbin.NET (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:24.060531+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-30T04:45:30.165040+00:00, confidence not recorded.
  - readme: https://github.com/apache/casbin-Casbin.NET (fetched 2026-08-28T04:04:24.060531+00:00, sha 62e45478af1d)
  - homepage: https://casbin.org (fetched 2026-08-29T12:04:36.001175+00:00, sha bf9a21b944e9)
  - site_page: https://casbin.apache.org/docs/ide-plugins (fetched 2026-08-29T12:04:36.017084+00:00, sha 5a9e92f4f45a)
  - site_page: https://casbin.apache.org/docs/overview (fetched 2026-08-29T12:04:36.003986+00:00, sha e6df9330fc66)
  - site_page: https://casbin.apache.org/docs/downloads (fetched 2026-08-29T12:04:36.005975+00:00, sha 34577d2c2ff2)
  - site_page: https://casbin.apache.org/docs/get-started (fetched 2026-08-29T12:04:36.007623+00:00, sha 1cef184398ca)
  - site_page: https://casbin.apache.org/docs/category/access-control-models (fetched 2026-08-29T12:04:36.009678+00:00, sha 323b2c9c0a23)
  - site_page: https://casbin.apache.org/docs/category/storage (fetched 2026-08-29T12:04:36.011441+00:00, sha 36570671a14a)
  - site_page: https://casbin.apache.org/docs/adapters (fetched 2026-08-29T12:04:36.013178+00:00, sha cd140120068d)
  - site_page: https://casbin.apache.org/docs/category/api (fetched 2026-08-29T12:04:36.015402+00:00, sha 4099ba1bb75f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
