RBAC with Conditions API
This page documents the API for RBAC with conditions: attaching condition functions to user–role links so that a link is valid only when the condition returns true.
Tham khảo
AddNamedLinkConditionFunc
Registers a condition function for the user–role link (userName, roleName). The link is considered valid only when the function returns true.
e.AddNamedLinkConditionFunc("g", "userName", "roleName", YourLinkConditionFunc)
AddNamedDomainLinkConditionFunc
Same as above for domain-scoped links: (userName, roleName, domainName). The link is valid only when the condition function returns true.
e.AddNamedDomainLinkConditionFunc("g", "userName", "roleName", "domainName", YourLinkConditionFunc)
SetNamedLinkConditionFuncParams
Sets the parameters passed to the condition function for the link (userName, roleName). Pass one or more string arguments.
e.SetNamedLinkConditionFuncParams("g", "userName", "roleName", "YourConditionFuncParam")
e.SetNamedLinkConditionFuncParams("g", "userName2", "roleName2", "YourConditionFuncParam_1", "YourConditionFuncParam_2")
SetNamedDomainLinkConditionFuncParams
Sets the parameters passed to the condition function for the domain-scoped link (userName, roleName, domainName).
e.SetNamedDomainLinkConditionFuncParams("g", "userName", "roleName", "domainName", "YourConditionFuncParam")
e.SetNamedDomainLinkConditionFuncParams("g", "userName2", "roleName2", "domainName2", "YourConditionFuncParam_1", "YourConditionFuncParam_2")