public class MapBasedAttributes2GrantedAuthoritiesMapper extends java.lang.Object implements Attributes2GrantedAuthoritiesMapper, MappableAttributesRetriever, org.springframework.beans.factory.InitializingBean
This class implements the Attributes2GrantedAuthoritiesMapper and MappableAttributesRetriever interfaces based on the supplied Map. It supports both one-to-one and one-to-many mappings. The granted authorities to map to can be supplied either as a String or as a GrantedAuthority object.
| Constructor and Description |
|---|
MapBasedAttributes2GrantedAuthoritiesMapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Check whether all properties have been set to correct values, and do some preprocessing.
|
java.util.Map |
getAttributes2grantedAuthoritiesMap() |
GrantedAuthority[] |
getGrantedAuthorities(java.lang.String[] attributes)
Map the given array of attributes to Spring Security GrantedAuthorities.
|
java.lang.String[] |
getMappableAttributes()
Implementations of this method should return a list of all string attributes which
can be mapped to GrantedAuthoritys.
|
java.lang.String |
getStringSeparator() |
void |
setAttributes2grantedAuthoritiesMap(java.util.Map attributes2grantedAuthoritiesMap) |
void |
setStringSeparator(java.lang.String stringSeparator) |
public MapBasedAttributes2GrantedAuthoritiesMapper()
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic GrantedAuthority[] getGrantedAuthorities(java.lang.String[] attributes)
getGrantedAuthorities in interface Attributes2GrantedAuthoritiesMapperpublic java.util.Map getAttributes2grantedAuthoritiesMap()
public void setAttributes2grantedAuthoritiesMap(java.util.Map attributes2grantedAuthoritiesMap)
attributes2grantedAuthoritiesMap - The attributes2grantedAuthoritiesMap to set.public java.lang.String[] getMappableAttributes()
MappableAttributesRetrievergetMappableAttributes in interface MappableAttributesRetrieverMappableAttributesRetriever.getMappableAttributes()public java.lang.String getStringSeparator()
public void setStringSeparator(java.lang.String stringSeparator)
stringSeparator - The stringSeparator to set.