public class ConditionalRoleManager extends DefaultRoleManager
| Constructor and Description |
|---|
ConditionalRoleManager(int maxHierarchyLevel) |
ConditionalRoleManager(int maxHierarchyLevel,
java.util.function.BiPredicate<java.lang.String,java.lang.String> matchingFunc,
java.util.function.BiPredicate<java.lang.String,java.lang.String> domainMatchingFunc) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDomainLinkConditionFunc(java.lang.String userName,
java.lang.String roleName,
java.lang.String domain,
java.util.function.Function<java.lang.String[],java.lang.Boolean> fn)
addDomainLinkConditionFunc is based on userName, roleName, domain, add LinkConditionFunc
|
void |
addLinkConditionFunc(java.lang.String userName,
java.lang.String roleName,
java.util.function.Function<java.lang.String[],java.lang.Boolean> fn)
addLinkConditionFunc is based on userName, roleName, add LinkConditionFunc
|
java.util.function.Function<java.lang.String[],java.lang.Boolean> |
getDomainLinkConditionFunc(java.lang.String userName,
java.lang.String roleName,
java.lang.String domain)
getDomainLinkConditionFunc get LinkConditionFunc based on userName, roleName, domain
|
java.util.function.Function<java.lang.String[],java.lang.Boolean> |
getLinkConditionFunc(java.lang.String userName,
java.lang.String roleName)
getLinkConditionFunc get LinkConditionFunc based on userName, roleName
|
java.util.List<java.lang.String> |
getLinkConditionFuncParams(java.lang.String userName,
java.lang.String roleName,
java.lang.String[] domain)
getLinkConditionFuncParams gets parameters of LinkConditionFunc based on userName, roleName, domain
|
boolean |
getNextRoles(org.casbin.jcasbin.rbac.Role currentRole,
org.casbin.jcasbin.rbac.Role nextRole,
java.lang.String[] domains,
java.util.Map<java.lang.String,org.casbin.jcasbin.rbac.Role> nextRoles) |
boolean |
hasLink(java.lang.String name1,
java.lang.String name2,
java.lang.String... domains)
hasLink determines whether role: name1 inherits role: name2. domain is a prefix to the roles.
|
boolean |
hasLinkHelper(java.lang.String targetName,
java.util.Map<java.lang.String,org.casbin.jcasbin.rbac.Role> roles,
int level,
java.lang.String... domains) |
void |
setDomainLinkConditionFuncParams(java.lang.String userName,
java.lang.String roleName,
java.lang.String domain,
java.lang.String... params)
SetDomainLinkConditionFuncParams sets parameters of LinkConditionFunc based on userName, roleName, domain
|
void |
setLinkConditionFuncParams(java.lang.String userName,
java.lang.String roleName,
java.lang.String... params)
SetLinkConditionFuncParams sets parameters of LinkConditionFunc based on userName, roleName, domain
|
addDomainMatchingFunc, addLink, addMatchingFunc, clear, deleteLink, getRoles, getUsers, printRoles, toStringpublic ConditionalRoleManager(int maxHierarchyLevel)
public ConditionalRoleManager(int maxHierarchyLevel,
java.util.function.BiPredicate<java.lang.String,java.lang.String> matchingFunc,
java.util.function.BiPredicate<java.lang.String,java.lang.String> domainMatchingFunc)
public boolean hasLink(java.lang.String name1,
java.lang.String name2,
java.lang.String... domains)
DefaultRoleManagerhasLink in interface RoleManagerhasLink in class DefaultRoleManagername1 - the first role (or a user).name2 - the second role.domains - the domain the roles belong to.public boolean hasLinkHelper(java.lang.String targetName,
java.util.Map<java.lang.String,org.casbin.jcasbin.rbac.Role> roles,
int level,
java.lang.String... domains)
public boolean getNextRoles(org.casbin.jcasbin.rbac.Role currentRole,
org.casbin.jcasbin.rbac.Role nextRole,
java.lang.String[] domains,
java.util.Map<java.lang.String,org.casbin.jcasbin.rbac.Role> nextRoles)
public java.util.function.Function<java.lang.String[],java.lang.Boolean> getLinkConditionFunc(java.lang.String userName,
java.lang.String roleName)
userName - the name of the user for whom the link condition function is retrieved.roleName - the name of the role for which the link condition function is retrieved.public java.util.function.Function<java.lang.String[],java.lang.Boolean> getDomainLinkConditionFunc(java.lang.String userName,
java.lang.String roleName,
java.lang.String domain)
userName - the name of the user for whom the link condition function is retrieved.roleName - the name of the role for which the link condition function is retrieved.domain - the domain associated with the link condition function.public java.util.List<java.lang.String> getLinkConditionFuncParams(java.lang.String userName,
java.lang.String roleName,
java.lang.String[] domain)
userName - the name of the user whose link condition function parameters are retrieved.roleName - the name of the role whose link condition function parameters are retrieved.domain - an array of domain names associated with the link condition function.public void addLinkConditionFunc(java.lang.String userName,
java.lang.String roleName,
java.util.function.Function<java.lang.String[],java.lang.Boolean> fn)
userName - the name of the user for whom the link condition function is being added.roleName - the name of the role associated with the link condition function.fn - the link condition function to be added, which takes an array of strings and returns a boolean.public void addDomainLinkConditionFunc(java.lang.String userName,
java.lang.String roleName,
java.lang.String domain,
java.util.function.Function<java.lang.String[],java.lang.Boolean> fn)
userName - the name of the user for whom the link condition function is being added.roleName - the name of the role associated with the link condition function.domain - the domain for which the link condition function is applicable.fn - the link condition function to be added, which takes an array of strings and returns a boolean.public void setLinkConditionFuncParams(java.lang.String userName,
java.lang.String roleName,
java.lang.String... params)
userName - the name of the user for whom the link condition function parameters are being set.roleName - the name of the role associated with the link condition function.params - the parameters to be set for the link condition function.public void setDomainLinkConditionFuncParams(java.lang.String userName,
java.lang.String roleName,
java.lang.String domain,
java.lang.String... params)
userName - the name of the user for whom the link condition function parameters are being set.roleName - the name of the role associated with the link condition function.domain - the domain related to the link condition function.params - the parameters to be set for the link condition function.Copyright © 2017–2025. All rights reserved.