|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.security.core.authority.mapping.SimpleAuthorityMapper
public final class SimpleAuthorityMapper
Simple one-to-one GrantedAuthoritiesMapper which allows for case conversion of the authority name
and the addition of a string prefix (which defaults to ROLE_).
| Constructor Summary | |
|---|---|
SimpleAuthorityMapper()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
Set<GrantedAuthority> |
mapAuthorities(Collection<? extends GrantedAuthority> authorities)
Creates a mapping of the supplied authorities based on the case-conversion and prefix settings. |
void |
setConvertToLowerCase(boolean convertToLowerCase)
Whether to convert the authority value to lower case in the mapping. |
void |
setConvertToUpperCase(boolean convertToUpperCase)
Whether to convert the authority value to upper case in the mapping. |
void |
setDefaultAuthority(String authority)
Sets a default authority to be assigned to all users |
void |
setPrefix(String prefix)
Sets the prefix which should be added to the authority name (if it doesn't already exist) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleAuthorityMapper()
| Method Detail |
|---|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic Set<GrantedAuthority> mapAuthorities(Collection<? extends GrantedAuthority> authorities)
mapAuthorities in interface GrantedAuthoritiesMapperauthorities - the original authorities
public void setPrefix(String prefix)
prefix - the prefix, typically to satisfy the behaviour of an AccessDecisionVoter.public void setConvertToUpperCase(boolean convertToUpperCase)
convertToUpperCase - defaults to falsepublic void setConvertToLowerCase(boolean convertToLowerCase)
convertToLowerCase - defaults to falsepublic void setDefaultAuthority(String authority)
authority - the name of the authority to be assigned to all users.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||