Skip to content

Documentation inconsistency in AuthorizationManager's verify method return type #15704

Closed
@ijnooyah

Description

@ijnooyah

Hi,

I noticed a discrepancy between the official Spring Security documentation and the actual code regarding the verify method in the AuthorizationManager interface.

Discrepancy:
In the official documentation, the verify method is shown as returning an AuthorizationDecision:

default AuthorizationDecision verify(Supplier<Authentication> authentication, Object secureObject)
        throws AccessDeniedException {
    // ...
}

However, in both the actual code and the same online API documentation, the verify method has a void return type:

    default void verify(Supplier<Authentication> authentication, T object) {
        AuthorizationDecision decision = this.check(authentication, object);
        if (decision != null && !decision.isGranted()) {
            throw new AccessDeniedException("Access Denied");
        }
    }

You can also see this in the official online API documentation:
AuthorizationManager API Documentation

Request for Clarification:

  • Was this an intentional difference in the documentation, perhaps to illustrate a conceptual point?
  • Or is this an error in the documentation that should be corrected?

It would be helpful to clarify whether the documentation needs to be updated to reflect the actual method signature in the code, or if there is an intended reason for this difference that we should be aware of.

Thank you for your assistance!

Best regards,
yoonji

Metadata

Metadata

Assignees

Labels

in: docsAn issue in Documentation or samplestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions