Skip to content

Spring Security 6 combined with AspectJ weaving of spring-security-aspects executes PreAuthorize twice #13160

Closed
@rolevinks

Description

@rolevinks

Describe the bug
We just updated Spring Security to version 6 in our project , and replaced the @EnableGlobalMethodSecurity with @EnableMethodSecurity, both with adviceMode ASPECTJ. Furthermore, we have a @PostFilter on some getters in our entities, so we also use the aspectj maven plugin.
Previously, this worked perfectly, but since the upgrade, the permission checks on methods in components are executed twice instead of once.

To Reproduce
See attached project.

Expected behavior
Permission checks are executed once.

Sample
test.zip

Metadata

Metadata

Assignees

Labels

in: configAn issue in spring-security-configtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions