Package org.springframework.security.authorization

# Interface AuthorizationEventPublisher

All Known Implementing Classes:
  `SpringAuthorizationEventPublisher`

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AuthorizationEventPublisher
A contract for publishing authorization events

Since:
  5.7
See Also:
  - `AuthorizationManager`

## Method Summary

Modifier and Type
Method
Description
`<T> void`
`publishAuthorizationEvent(Supplier<Authentication> authentication, T object, AuthorizationDecision decision)`
Deprecated.
use `publishAuthorizationEvent(Supplier, Object, AuthorizationResult)` instead
`default <T> void`
`publishAuthorizationEvent(Supplier<Authentication> authentication, T object, AuthorizationResult result)`
Publish the given details in the form of an event, typically `AuthorizationGrantedEvent` or `AuthorizationDeniedEvent`.

## Method Details

### publishAuthorizationEvent

@Deprecated <T> void publishAuthorizationEvent(Supplier<Authentication> authentication, T object, AuthorizationDecision decision)
Deprecated.
use `publishAuthorizationEvent(Supplier, Object, AuthorizationResult)` instead
Publish the given details in the form of an event, typically `AuthorizationGrantedEvent` or `AuthorizationDeniedEvent`. Note that success events can be very noisy if enabled by default. Because of this implementations may choose to drop success events by default.

Type Parameters:
  `T` - the secured object's type
Parameters:
  `authentication` - a `Supplier` for the current user
  `object` - the secured object
  `decision` - the decision about whether the user may access the secured object

### publishAuthorizationEvent

default <T> void publishAuthorizationEvent(Supplier<Authentication> authentication, T object, AuthorizationResult result)
Publish the given details in the form of an event, typically `AuthorizationGrantedEvent` or `AuthorizationDeniedEvent`. Note that success events can be very noisy if enabled by default. Because of this implementations may choose to drop success events by default.

Type Parameters:
  `T` - the secured object's type
Parameters:
  `authentication` - a `Supplier` for the current user
  `object` - the secured object
  `result` - `AuthorizationResult` the result about whether the user may access the secured object
Since:
  6.4