Package org.wildfly.security.authz
Class MappedRoleMapper
java.lang.Object
org.wildfly.security.authz.MappedRoleMapper
- All Implemented Interfaces:
RoleMapper
A simple mapping role mapper.
Maps each role to a set of new roles using a String to Set map.
- Author:
- Martin Mazanek
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for map backed role mappers. -
Field Summary
Fields inherited from interface org.wildfly.security.authz.RoleMapper
IDENTITY_ROLE_MAPPER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MappedRoleMapper.Builderbuilder()Construct a newMappedRoleMapper.Builderfor creating theMappedRoleMapper.voidinitialize(Map<String, String> configuration) Custom component method.Returns a set of strings representing the roles mapped from the given roles in their raw form.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.security.authz.RoleMapper
and, minus, or, xor
-
Constructor Details
-
MappedRoleMapper
public MappedRoleMapper()Construct a new instance. Called from WildFly core when using this as a custom component. You should not use this constructor and useMappedRoleMapper.Builderinstead. You must callinitialize(Map)to configure mapping map before usage.- See Also:
-
-
Method Details
-
initialize
Custom component method. Called from WildFly core. Used to include mapped role mapping functionality in older WildFly versions.- Parameters:
configuration- map of mapping rules where key is delegate role and value is whitespace separated list of new roles- Throws:
IllegalStateException- when called mapper is already initialized
-
mapRoles
Description copied from interface:RoleMapperReturns a set of strings representing the roles mapped from the given roles in their raw form.- Specified by:
mapRolesin interfaceRoleMapper- Parameters:
rolesToMap- the roles in their raw form to apply mapping- Returns:
- the mapped role set
-
builder
Construct a newMappedRoleMapper.Builderfor creating theMappedRoleMapper.- Returns:
- a new
MappedRoleMapper.Builderfor creating theMappedRoleMapper.
-