Interface GrantedAuthority
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
JaasGrantedAuthority,LdapAuthority,OAuth2UserAuthority,OidcUserAuthority,SimpleGrantedAuthority,SwitchUserGrantedAuthority
Represents an authority granted to an
Authentication object.
A GrantedAuthority must either represent itself as a String
or be specifically supported by an AccessDecisionManager.
-
Method Summary
Modifier and TypeMethodDescriptionIf theGrantedAuthoritycan be represented as aStringand thatStringis sufficient in precision to be relied upon for an access control decision by anAccessDecisionManager(or delegate), this method should return such aString.
-
Method Details
-
getAuthority
String getAuthority()If theGrantedAuthoritycan be represented as aStringand thatStringis sufficient in precision to be relied upon for an access control decision by anAccessDecisionManager(or delegate), this method should return such aString.If the
GrantedAuthoritycannot be expressed with sufficient precision as aString,nullshould be returned. Returningnullwill require anAccessDecisionManager(or delegate) to specifically support theGrantedAuthorityimplementation, so returningnullshould be avoided unless actually required.- Returns:
- a representation of the granted authority (or
nullif the granted authority cannot be expressed as aStringwith sufficient precision).
-