跳到主要内容

**Role Managers**

role manager(角色管理器)实现了 RBAC 角色层级结构(谁拥有哪个角色,以及角色继承关系)。Casbin 可以使用默认的内存角色管理器(由策略支持),或者插入外部源(例如 LDAP、Okta、Auth0、Azure AD)。自定义角色管理器位于单独的包中。按语言列出的可用角色管理器如下:

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

所有角色管理器都必须实现 RoleManager 接口。请参考 Session Role Manager 作为参考实现。

API​

详见 API 部分。

Comments are powered by giscus and GitHub Discussions. They load from giscus.app and GitHub only after you click the button below.