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 decision) Construct anAuthorizationEvent
-
Method Summary
Modifier and TypeMethodDescriptionGet the principal requiring accessGet the response to the princpal'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 decision) Construct anAuthorizationEvent
- Parameters:
authentication
- the principal requiring accessobject
- the object to which access was requesteddecision
- 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
Get the response to the princpal's request- Returns:
-