RBAC with Conditions API
This API provides a simplified interface for working with RBAC with conditions.
参照
AddNamedLinkConditionFunc
AddNamedLinkConditionFunc attaches a condition function to a link between userName and roleName. The link is valid only when the function returns true.
e.AddNamedLinkConditionFunc("g", "userName", "roleName", YourLinkConditionFunc)
AddNamedDomainLinkConditionFunc
AddNamedDomainLinkConditionFunc attaches a condition function to a link between userName and {roleName, domain}. The link is valid only when the function returns true.
e.AddNamedDomainLinkConditionFunc("g", "userName", "roleName", "domainName", YourLinkConditionFunc)
SetNamedLinkConditionFuncParams
SetNamedLinkConditionFuncParams configures the parameters passed to the condition function for a link between userName and roleName.
e.SetNamedLinkConditionFuncParams("g", "userName", "roleName", "YourConditionFuncParam")
e.SetNamedLinkConditionFuncParams("g", "userName2", "roleName2", "YourConditionFuncParam_1", "YourConditionFuncParam_2")
SetNamedDomainLinkConditionFuncParams
SetNamedDomainLinkConditionFuncParams configures the parameters passed to the condition function for a link between userName and {roleName, domain}.
e.SetNamedDomainLinkConditionFuncParams("g", "userName", "roleName", "domainName", "YourConditionFuncParam")
e.SetNamedDomainLinkConditionFuncParams("g", "userName2", "roleName2", "domainName2", "YourConditionFuncParam_1", "YourConditionFuncParam_2")