Throw AuthorizationDeniedException when AuthorizationResult is available

Closes gh-15706
This commit is contained in:
Marcus Hert Da Coregio
2024-09-09 14:45:48 -03:00
parent 7ac32e07bc
commit 2ff29dc229
2 changed files with 3 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ public interface AuthorizationManager<T> {
default void verify(Supplier<Authentication> authentication, T object) {
AuthorizationDecision decision = check(authentication, object);
if (decision != null && !decision.isGranted()) {
throw new AccessDeniedException("Access Denied");
throw new AuthorizationDeniedException("Access Denied", decision);
}
}