You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The reason this works is because it is publishing the same bean as a MethodInterceptor instead of an Advisor, meaning that Spring doesn't try picking it up as an AOP Advisor as well.
To fix this passively in Spring Security may take a bit of research; however, I believe one way to address it is to publish a different configuration class when the advice mode is ASPECTJ. In that case, the components can be registered as MethodInterceptors instead.
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
The text was updated successfully, but these errors were encountered: