public class

MapBasedAttributes2GrantedAuthoritiesMapper

extends Object
implements InitializingBean Attributes2GrantedAuthoritiesMapper MappableAttributesRetriever
java.lang.Object
   ↳ org.springframework.security.core.authority.mapping.MapBasedAttributes2GrantedAuthoritiesMapper

Class Overview

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.

Summary

Public Constructors
MapBasedAttributes2GrantedAuthoritiesMapper()
Public Methods
void afterPropertiesSet()
Map<StringCollection<GrantedAuthority>> getAttributes2grantedAuthoritiesMap()
List<GrantedAuthority> getGrantedAuthorities(Collection<String> attributes)
Map the given array of attributes to Spring Security GrantedAuthorities.
Set<String> getMappableAttributes()
Implementations of this method should return a set of all string attributes which can be mapped to GrantedAuthoritys.
String getStringSeparator()
void setAttributes2grantedAuthoritiesMap(Map<?, ?> attributes2grantedAuthoritiesMap)
void setStringSeparator(String stringSeparator)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.security.core.authority.mapping.Attributes2GrantedAuthoritiesMapper
From interface org.springframework.security.core.authority.mapping.MappableAttributesRetriever

Public Constructors

public MapBasedAttributes2GrantedAuthoritiesMapper ()

Public Methods

public void afterPropertiesSet ()

Throws
Exception

public Map<StringCollection<GrantedAuthority>> getAttributes2grantedAuthoritiesMap ()

Returns
  • Returns the attributes2grantedAuthoritiesMap.

public List<GrantedAuthority> getGrantedAuthorities (Collection<String> attributes)

Map the given array of attributes to Spring Security GrantedAuthorities.

Parameters
attributes the attributes to be mapped
Returns
  • the collection of authorities created from the attributes

public Set<String> getMappableAttributes ()

Implementations of this method should return a set of all string attributes which can be mapped to GrantedAuthoritys.

Returns
  • set of all mappable roles

public String getStringSeparator ()

Returns
  • Returns the stringSeparator.

public void setAttributes2grantedAuthoritiesMap (Map<?, ?> attributes2grantedAuthoritiesMap)

Parameters
attributes2grantedAuthoritiesMap The attributes2grantedAuthoritiesMap to set.

public void setStringSeparator (String stringSeparator)

Parameters
stringSeparator The stringSeparator to set.