Documentation ¶
Index ¶
Constants ¶
View Source
const ExtendedRBACWithDomainModelString = `` /* 356-byte string literal not displayed */
RBAC with domain model for Casbin, supports evaluation of extra information
- sub: user / role
- ext: extra information
- ext_rule: expression to evaluate extra information
- dom: domain
- obj: object, supports gin router key match (EX: /api/v1/user/:id/*any)
- act: action, supports regex match (EX: GET | POST)
- eft: effect
Router key match will not work if keyMatchGin is not defined in the model.
You should also prepare an extra information struct to evaluate the extra information and make sure the policy ext_rule is using the correct field (which is included in the extra information struct).
View Source
const RoleSubjectPrefix = "role:"
View Source
const UserSubjectPrefix = "user:"
Variables ¶
This section is empty.
Functions ¶
func GetDefaultCasbinEnforcer ¶
func GetDefaultCasbinEnforcer() *casbin.SyncedCachedEnforcer
func KeyMatchGin ¶
KeyMatchGin determines whether key1 matches the pattern of key2 (similar to KeyMatch2 in Casbin). Providing a Gin-like path matching pattern.
Types ¶
type DomainRole ¶
Click to show internal directories.
Click to hide internal directories.