Package org.springframework.security.authorization

# Class AuthorizationDeniedException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.security.access.AccessDeniedException
org.springframework.security.authorization.AuthorizationDeniedException

All Implemented Interfaces:
  `Serializable`, `AuthorizationResult`

public class AuthorizationDeniedException extends AccessDeniedException implements AuthorizationResult
An `AccessDeniedException` that contains the `AuthorizationResult`

Since:
  6.3
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`AuthorizationDeniedException(String msg)`
`AuthorizationDeniedException(String msg, AuthorizationResult authorizationResult)`

## Method Summary

Modifier and Type
Method
Description
`AuthorizationResult`
`getAuthorizationResult()`
`boolean`
`isGranted()`

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

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

## Constructor Details

### AuthorizationDeniedException

public AuthorizationDeniedException(String msg, AuthorizationResult authorizationResult)

### AuthorizationDeniedException

public AuthorizationDeniedException(String msg)

## Method Details

### getAuthorizationResult

public AuthorizationResult getAuthorizationResult()

### isGranted

public boolean isGranted()

Specified by:
  `isGranted` in interface `AuthorizationResult`
Returns:
  whether the access has been granted