Class SpringAuthorizationEventPublisher

    • Constructor Detail

      • SpringAuthorizationEventPublisher

        public SpringAuthorizationEventPublisher​(org.springframework.context.ApplicationEventPublisher eventPublisher)
        Construct this publisher using Spring's ApplicationEventPublisher
        Parameters:
        eventPublisher -
    • Method Detail

      • publishAuthorizationEvent

        public <T> void publishAuthorizationEvent​(java.util.function.Supplier<Authentication> authentication,
                                                  T object,
                                                  AuthorizationDecision decision)
        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.
        Specified by:
        publishAuthorizationEvent in interface AuthorizationEventPublisher
        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