Class SwitchUserGrantedAuthority
java.lang.Object
org.springframework.security.web.authentication.switchuser.SwitchUserGrantedAuthority
- All Implemented Interfaces:
Serializable,GrantedAuthority
Custom
GrantedAuthority used by
SwitchUserFilter
Stores the Authentication object of the original user to be used later when
'exiting' from a user switch.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf 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.Returns the original user associated with a successful user switch.inthashCode()toString()
-
Constructor Details
-
SwitchUserGrantedAuthority
-
-
Method Details
-
getSource
Returns the original user associated with a successful user switch.- Returns:
- The original
Authenticationobject of the switched user.
-
getAuthority
Description copied from interface:GrantedAuthorityIf 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.- Specified by:
getAuthorityin interfaceGrantedAuthority- Returns:
- a representation of the granted authority (or
nullif the granted authority cannot be expressed as aStringwith sufficient precision).
-
equals
-
hashCode
public int hashCode() -
toString
-