Package org.springframework.security.authorization.method

# 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

Constructors
Constructor
Description
`ThrowingMethodAuthorizationDeniedHandler()`

## Method Summary

Modifier and Type
Method
Description
`Object`
`handleDeniedInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation, AuthorizationResult authorizationResult)`
Handle denied method invocations, implementations might either throw an `AuthorizationDeniedException` or a replacement result instead of invoking the method, e.g.
`Object`
`handleDeniedInvocationResult(MethodInvocationResult methodInvocationResult, AuthorizationResult authorizationResult)`
Handle denied method invocations, implementations might either throw an `AuthorizationDeniedException` or a replacement result instead of invoking the method, e.g.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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 an `AuthorizationDeniedException` or a replacement result instead of invoking the method, e.g. a masked value.

Specified by:
  `handleDeniedInvocation` in interface `MethodAuthorizationDeniedHandler`
Parameters:
  `methodInvocation` - the `MethodInvocation` related to the authorization denied
  `authorizationResult` - 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 an `AuthorizationDeniedException` or a replacement result instead of invoking the method, e.g. a masked value. By default, this method invokes `MethodAuthorizationDeniedHandler.handleDeniedInvocation(MethodInvocation, AuthorizationResult)`.

Specified by:
  `handleDeniedInvocationResult` in interface `MethodAuthorizationDeniedHandler`
Parameters:
  `methodInvocationResult` - the object containing the `MethodInvocation` and the result produced
  `authorizationResult` - the authorization denied result
Returns:
  a replacement result for the denied method invocation, or null, or a `Mono` for reactive applications