⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

SecurityExpressionRoot#hasAuthority should delegate to AuthorizationManagerFactory#hasAuthority(String) #18486

@thuri

Description

@thuri

Expected Behavior

The hasAuthority method of a provided custom AuthorizationManagerFactory should be called when using @PreAuthorize("hasAuthority('foobar')" on a method.

Current Behavior

the hasAnyAuthority method of AuthorizationManagerFactory is called by SecurityExpressionRoot f@PreAuthorize("hasAuthority('foobar')"

Context

I added a Custom AuthorizationManagerFactory as described here.

But instead of handling hasRole as in the example i tried to override hasAuthority. But my method wasn't called.

Using the debugger I found out that SecurityExpressionRoot is actually calling hasAnyAuthority on the AuthorizationManagerFactory.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions