public class

SimpleAttributes2GrantedAuthoritiesMapper

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

Class Overview

This class implements the Attributes2GrantedAuthoritiesMapper interface by doing a one-to-one mapping from roles to Spring Security GrantedAuthorities. Optionally a prefix can be added, and the attribute name can be converted to upper or lower case.

By default, the attribute is prefixed with "ROLE_" unless it already starts with "ROLE_", and no case conversion is done.

Summary

Public Constructors
SimpleAttributes2GrantedAuthoritiesMapper()
Public Methods
void afterPropertiesSet()
Check whether all properties have been set to correct values.
List<GrantedAuthority> getGrantedAuthorities(Collection<String> attributes)
Map the given list of string attributes one-to-one to Spring Security GrantedAuthorities.
void setAddPrefixIfAlreadyExisting(boolean b)
void setAttributePrefix(String string)
void setConvertAttributeToLowerCase(boolean b)
void setConvertAttributeToUpperCase(boolean b)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.security.core.authority.mapping.Attributes2GrantedAuthoritiesMapper

Public Constructors

public SimpleAttributes2GrantedAuthoritiesMapper ()

Public Methods

public void afterPropertiesSet ()

Check whether all properties have been set to correct values.

Throws
Exception

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

Map the given list of string attributes one-to-one to Spring Security GrantedAuthorities.

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

public void setAddPrefixIfAlreadyExisting (boolean b)

public void setAttributePrefix (String string)

public void setConvertAttributeToLowerCase (boolean b)

public void setConvertAttributeToUpperCase (boolean b)