Skip to content

Commit

Permalink
Authorisation denied fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ewan Donovan committed Feb 26, 2025
1 parent 034308b commit 348b34d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.slf4j.Logger
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.http.converter.HttpMessageNotReadableException
import org.springframework.security.authorization.AuthorizationDeniedException
import org.springframework.validation.BindingResult
import org.springframework.web.HttpRequestMethodNotSupportedException
import org.springframework.web.bind.MethodArgumentNotValidException
Expand Down Expand Up @@ -74,9 +75,9 @@ class HmppsBoldLrsExceptionHandler {
return ResponseEntity(errorResponse, HttpStatus.NOT_FOUND)
}

@ExceptionHandler(AccessDeniedException::class)
fun handleAccessDeniedException(
ex: AccessDeniedException,
@ExceptionHandler(AccessDeniedException::class, AuthorizationDeniedException::class)
fun handleDeniedException(
ex: RuntimeException,
request: WebRequest,
): ResponseEntity<ErrorResponse> {
val errorResponse = ErrorResponse(
Expand Down

0 comments on commit 348b34d

Please sign in to comment.