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 theGrantedAuthority
can be represented as aString
and thatString
is 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 theGrantedAuthority
can be represented as aString
and thatString
is sufficient in precision to be relied upon for an access control decision by anAccessDecisionManager
(or delegate), this method should return such aString
.If the
GrantedAuthority
cannot be expressed with sufficient precision as aString
,null
should be returned. Returningnull
will require anAccessDecisionManager
(or delegate) to specifically support theGrantedAuthority
implementation, so returningnull
should be avoided unless actually required.- Returns:
- a representation of the granted authority (or
null
if the granted authority cannot be expressed as aString
with sufficient precision).
-