Passer au contenu principal

Role Managers

The role manager handles the RBAC role hierarchy (user-role mapping) in Casbin. It can retrieve role data from Casbin policy rules or from external sources such as LDAP, Okta, Auth0, Azure AD, and others. We support multiple role manager implementations. To keep the main library lightweight, role manager code (except the default implementation) is maintained separately. Below is a complete list of available Casbin role managers. We welcome contributions for new role managers—please let us know, and we'll add them to this list.

Role manager Author Description
Default Role Manager (built-in) Casbin Supports role hierarchy stored in the Casbin policy
Session Role Manager EDOMO Systems Supports role hierarchy stored in the Casbin policy, with time-range-based sessions
Okta Role Manager Casbin Supports role hierarchy stored in Okta
Auth0 Role Manager Casbin Supports role hierarchy stored in Auth0's Authorization Extension

All role managers must implement the RoleManager interface. Use the Session Role Manager as a reference implementation.

API

Voir la section API pour plus de détails.