Class ThrowingMethodAuthorizationDeniedHandler
java.lang.Object
org.springframework.security.authorization.method.ThrowingMethodAuthorizationDeniedHandler
- All Implemented Interfaces:
MethodAuthorizationDeniedHandler
public final class ThrowingMethodAuthorizationDeniedHandler
extends Object
implements MethodAuthorizationDeniedHandler
An implementation of
MethodAuthorizationDeniedHandler
that throws
AuthorizationDeniedException
- Since:
- 6.3
-
Constructor Summary
-
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.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.
-
Constructor Details
-
ThrowingMethodAuthorizationDeniedHandler
public ThrowingMethodAuthorizationDeniedHandler()
-
-
Method Details
-
handleDeniedInvocation
public Object handleDeniedInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation, AuthorizationResult authorizationResult) Description copied from interface:MethodAuthorizationDeniedHandler
Handle denied method invocations, implementations might either throw anAuthorizationDeniedException
or a replacement result instead of invoking the method, e.g. a masked value.- Specified by:
handleDeniedInvocation
in interfaceMethodAuthorizationDeniedHandler
- 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
public Object handleDeniedInvocationResult(MethodInvocationResult methodInvocationResult, AuthorizationResult authorizationResult) Description copied from interface:MethodAuthorizationDeniedHandler
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 invokesMethodAuthorizationDeniedHandler.handleDeniedInvocation(MethodInvocation, AuthorizationResult)
.- Specified by:
handleDeniedInvocationResult
in interfaceMethodAuthorizationDeniedHandler
- 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
-