跳转至主要内容

Role Managers

角色管理器 实现 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.