Package org.wildfly.security.authz
Interface RoleMapper
- All Known Implementing Classes:
MappedRoleMapper,RegexRoleMapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A role mapper is responsible for mapping roles based on their raw form.
Roles are basically represented as String values, where these values are their names. Role mapping allows to transform roles
from their raw form (eg.: just like they were loaded from a identity store such as a database or LDAP server) in a more consistent
form.
- Author:
- Pedro Igor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RoleMapperA default implementation that does nothing but return the given roles. -
Method Summary
Modifier and TypeMethodDescriptionstatic RoleMapperaggregate(RoleMapper... mappers) Create an aggregate role mapper.static RoleMapperaggregate(RoleMapper mapper1, RoleMapper mapper2) Create an aggregate role mapper.default RoleMapperand(RoleMapper other) Create a role mapper which is the intersection (logical "and") of the results of this and the given role mapper.static RoleMapperCreate a role mapper that always returns the same set of roles regardless of the input.Returns a set of strings representing the roles mapped from the given roles in their raw form.default RoleMapperminus(RoleMapper other) Create a role mapper which contains all the roles mapped by this mapper, minus the roles mapped by the given role mapper.default RoleMapperor(RoleMapper other) Create a role mapper which is the union (logical "or") of the results of this and the given role mapper.default RoleMapperxor(RoleMapper other) Create a role mapper which is the symmetric difference (or disjunction, or logical "xor") of the results of this and the given role mapper.
-
Field Details
-
IDENTITY_ROLE_MAPPER
A default implementation that does nothing but return the given roles.
-
-
Method Details
-
mapRoles
Returns a set of strings representing the roles mapped from the given roles in their raw form.- Parameters:
rolesToMap- the roles in their raw form to apply mapping- Returns:
- the mapped role set
-
and
Create a role mapper which is the intersection (logical "and") of the results of this and the given role mapper.- Parameters:
other- the other role mapper- Returns:
- the intersection role mapper
-
or
Create a role mapper which is the union (logical "or") of the results of this and the given role mapper.- Parameters:
other- the other role mapper- Returns:
- the union role mapper
-
xor
Create a role mapper which is the symmetric difference (or disjunction, or logical "xor") of the results of this and the given role mapper.- Parameters:
other- the other role mapper- Returns:
- the difference role mapper
-
minus
Create a role mapper which contains all the roles mapped by this mapper, minus the roles mapped by the given role mapper.- Parameters:
other- the other role mapper- Returns:
- the difference role mapper
-
aggregate
Create an aggregate role mapper. Each role mapper is applied in order.- Parameters:
mapper1- the first role mapper to apply (must not benull)mapper2- the second role mapper to apply (must not benull)- Returns:
- the aggregate role mapper (not
null)
-
aggregate
Create an aggregate role mapper. Each role mapper is applied in order.- Parameters:
mappers- the role mappers to apply (most not benullor containnullelements)- Returns:
- the aggregate role mapper (not
null)
-
constant
Create a role mapper that always returns the same set of roles regardless of the input.- Parameters:
roles- the set of roles to always be returned (must not benull)- Returns:
- the constant role mapper (not
null)
-