Skip to content

DenyAllPermissionEvaluator Used As Silent Backup When Two PermissionEvaluator Beans Exist #16872

Open
@dcarrol3

Description

@dcarrol3

Describe the bug
When two or more PermissionEvaluator beans are present in an application, Spring seems to silently choose the DenyAllPermissionEvaluator instead of failing to startup due to having duplicate beans.

This feels like a bug, and could have dangerous consequences for enterprises by silently pushing out code to production that seems to build/run as expected, but once an endpoint is hit that calls hasPermission(), it is always denied.

spring-boot team reported it is due to this logic.

To Reproduce
Create two or more PermissionEvaluators in the same project (through an external dependency or otherwise)

Expected behavior
I think Spring should be failing at startup if there are multiple PermissionsEvaluators similar to behavior for other duplicate beans, or otherwise clearly warn developers of the case.

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