Class AuthorizationEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.security.authorization.event.AuthorizationEvent
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AuthorizationDeniedEvent
,AuthorizationGrantedEvent
public class AuthorizationEvent
extends org.springframework.context.ApplicationEvent
A parent class for
AuthorizationGrantedEvent
and
AuthorizationDeniedEvent
.- Since:
- 5.8
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionAuthorizationEvent
(Supplier<Authentication> authentication, Object object, AuthorizationDecision result) Construct anAuthorizationEvent
AuthorizationEvent
(Supplier<Authentication> authentication, Object object, AuthorizationResult result) Construct anAuthorizationEvent
-
Method Summary
Modifier and TypeMethodDescriptionGet the principal requiring accessDeprecated.Get the response to the principal's requestGet the object to which access was requestedMethods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
AuthorizationEvent
public AuthorizationEvent(Supplier<Authentication> authentication, Object object, AuthorizationDecision result) Construct anAuthorizationEvent
- Parameters:
authentication
- the principal requiring accessobject
- the object to which access was requestedresult
- whether authorization was granted or denied
-
AuthorizationEvent
public AuthorizationEvent(Supplier<Authentication> authentication, Object object, AuthorizationResult result) Construct anAuthorizationEvent
- Parameters:
authentication
- the principal requiring accessobject
- the object to which access was requestedresult
- whether authorization was granted or denied
-
-
Method Details
-
getAuthentication
Get the principal requiring access- Returns:
- the principal requiring access
-
getObject
Get the object to which access was requested- Returns:
- the object to which access was requested
-
getAuthorizationDecision
Deprecated.please usegetAuthorizationResult()
Get the response to the principal's request- Returns:
- the response to the principal's request
-
getAuthorizationResult
Get the response to the principal's request- Returns:
- the response to the principal's request
- Since:
- 6.4
-
getAuthorizationResult()