RBAC with Conditions API
A more user-friendly API for RBAC with conditions.
Reference
AddNamedLinkConditionFunc
AddNamedLinkConditionFunc
Add condition function fn for Link userName->roleName
,
when fn returns true, Link is valid, otherwise invalid
- Go
e.AddNamedLinkConditionFunc("g", "userName", "roleName", YourLinkConditionFunc)
AddNamedDomainLinkConditionFunc
AddNamedDomainLinkConditionFunc
Add condition function fn for Link userName-> {roleName, domain}
,
when fn returns true, Link is valid, otherwise invalid
- Go
e.AddNamedDomainLinkConditionFunc("g", "userName", "roleName", "domainName", YourLinkConditionFunc)
SetNamedLinkConditionFuncParams
SetNamedLinkConditionFuncParams
Sets the parameters of the condition function fn for Link userName->roleName
- Go
e.SetNamedLinkConditionFuncParams("g", "userName", "roleName", "YourConditionFuncParam")
e.SetNamedLinkConditionFuncParams("g", "userName2", "roleName2", "YourConditionFuncParam_1", "YourConditionFuncParam_2")
SetNamedDomainLinkConditionFuncParams
SetNamedDomainLinkConditionFuncParams
Sets the parameters of the condition function fn
for Link userName->{roleName, domain}
- Go
e.SetNamedDomainLinkConditionFuncParams("g", "userName", "roleName", "domainName", "YourConditionFuncParam")
e.SetNamedDomainLinkConditionFuncParams("g", "userName2", "roleName2", "domainName2", "YourConditionFuncParam_1", "YourConditionFuncParam_2")