Package org.infinispan.security.mappers
Class ClusterRoleMapper
- java.lang.Object
-
- org.infinispan.security.mappers.ClusterRoleMapper
-
- All Implemented Interfaces:
MutablePrincipalRoleMapper
,PrincipalRoleMapper
- Direct Known Subclasses:
ClusterRoleMapper
public class ClusterRoleMapper extends Object implements MutablePrincipalRoleMapper
ClusterRoleMapper. This class implements both aMutablePrincipalRoleMapper
storing the mappings in a persistent replicated internal cache named org.infinispan.ROLES- Since:
- 7.0
- Author:
- Tristan Tarrant
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClusterRoleMapper.RoleSet
-
Constructor Summary
Constructors Constructor Description ClusterRoleMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deny(String roleName, String principalName)
void
grant(String roleName, String principalName)
Set<String>
list(String principalName)
String
listAll()
Set<String>
principalToRoles(Principal principal)
Maps a principal name to a set of role names.void
setContext(PrincipalRoleMapperContext context)
Sets the context for thisPrincipalRoleMapper
-
-
-
Method Detail
-
principalToRoles
public Set<String> principalToRoles(Principal principal)
Description copied from interface:PrincipalRoleMapper
Maps a principal name to a set of role names. The principal name depends on the source of the principal itself. For example, in LDAP a Principal might use the Distinguished Name format (DN). The mapper should return null if it does not recognize the principal.- Specified by:
principalToRoles
in interfacePrincipalRoleMapper
- Returns:
- list of roles the principal belongs to
-
setContext
public void setContext(PrincipalRoleMapperContext context)
Description copied from interface:PrincipalRoleMapper
Sets the context for thisPrincipalRoleMapper
- Specified by:
setContext
in interfacePrincipalRoleMapper
-
grant
public void grant(String roleName, String principalName)
- Specified by:
grant
in interfaceMutablePrincipalRoleMapper
-
deny
public void deny(String roleName, String principalName)
- Specified by:
deny
in interfaceMutablePrincipalRoleMapper
-
list
public Set<String> list(String principalName)
- Specified by:
list
in interfaceMutablePrincipalRoleMapper
-
listAll
public String listAll()
- Specified by:
listAll
in interfaceMutablePrincipalRoleMapper
-
-