Interface MethodAuthorizationDeniedHandler
- All Known Implementing Classes:
ObservationAuthorizationManager
,ObservationReactiveAuthorizationManager
,PostAuthorizeAuthorizationManager
,PostAuthorizeReactiveAuthorizationManager
,PreAuthorizeAuthorizationManager
,PreAuthorizeReactiveAuthorizationManager
,ThrowingMethodAuthorizationDeniedHandler
public interface MethodAuthorizationDeniedHandler
An interface used to define a strategy to handle denied method invocations
- Since:
- 6.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionhandleDeniedInvocation
(org.aopalliance.intercept.MethodInvocation methodInvocation, AuthorizationResult authorizationResult) Handle denied method invocations, implementations might either throw anAuthorizationDeniedException
or a replacement result instead of invoking the method, e.g.default Object
handleDeniedInvocationResult
(MethodInvocationResult methodInvocationResult, AuthorizationResult authorizationResult) Handle denied method invocations, implementations might either throw anAuthorizationDeniedException
or a replacement result instead of invoking the method, e.g.
-
Method Details
-
handleDeniedInvocation
@Nullable Object handleDeniedInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation, AuthorizationResult authorizationResult) Handle denied method invocations, implementations might either throw anAuthorizationDeniedException
or a replacement result instead of invoking the method, e.g. a masked value.- Parameters:
methodInvocation
- theMethodInvocation
related to the authorization deniedauthorizationResult
- the authorization denied result- Returns:
- a replacement result for the denied method invocation, or null, or a
Mono
for reactive applications
-
handleDeniedInvocationResult
@Nullable default Object handleDeniedInvocationResult(MethodInvocationResult methodInvocationResult, AuthorizationResult authorizationResult) Handle denied method invocations, implementations might either throw anAuthorizationDeniedException
or a replacement result instead of invoking the method, e.g. a masked value. By default, this method invokeshandleDeniedInvocation(MethodInvocation, AuthorizationResult)
.- Parameters:
methodInvocationResult
- the object containing theMethodInvocation
and the result producedauthorizationResult
- the authorization denied result- Returns:
- a replacement result for the denied method invocation, or null, or a
Mono
for reactive applications
-