@FunctionalInterface public interface RoleMapper
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.
Modifier and Type | Field and Description |
---|---|
static RoleMapper |
IDENTITY_ROLE_MAPPER
A default implementation that does nothing but return the given roles.
|
Modifier and Type | Method and Description |
---|---|
static RoleMapper |
aggregate(RoleMapper... mappers)
Create an aggregate role mapper.
|
static RoleMapper |
aggregate(RoleMapper mapper1,
RoleMapper mapper2)
Create an aggregate role mapper.
|
default RoleMapper |
and(RoleMapper other)
Create a role mapper which is the intersection (logical "and") of the results of this and the given role mapper.
|
static RoleMapper |
constant(Roles roles)
Create a role mapper that always returns the same set of roles regardless of the input.
|
Roles |
mapRoles(Roles rolesToMap)
Returns a set of strings representing the roles mapped from the given roles in their raw form.
|
default RoleMapper |
minus(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 RoleMapper |
or(RoleMapper other)
Create a role mapper which is the union (logical "or") of the results of this and the given role mapper.
|
default RoleMapper |
xor(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.
|
static final RoleMapper IDENTITY_ROLE_MAPPER
Roles mapRoles(Roles rolesToMap)
rolesToMap
- the roles in their raw form to apply mappingdefault RoleMapper and(RoleMapper other)
other
- the other role mapperdefault RoleMapper or(RoleMapper other)
other
- the other role mapperdefault RoleMapper xor(RoleMapper other)
other
- the other role mapperdefault RoleMapper minus(RoleMapper other)
other
- the other role mapperstatic RoleMapper aggregate(RoleMapper mapper1, RoleMapper mapper2)
mapper1
- the first role mapper to apply (must not be null
)mapper2
- the second role mapper to apply (must not be null
)null
)static RoleMapper aggregate(RoleMapper... mappers)
mappers
- the role mappers to apply (most not be null
or contain null
elements)null
)static RoleMapper constant(Roles roles)
roles
- the set of roles to always be returned (must not be null
)null
)Copyright © 2019 JBoss by Red Hat. All rights reserved.