Description
Expected Behavior
The expression handler that gets created per default in PrePostMethodSecurityConfiguration
at
DenyAllPermissionEvaluator
.
Current Behavior
The expression handler should be setup in the PrePostMethodSecurityConfiguration
with the existing permission evaluator like
@Autowired(required = false)
void setPermissionEvaluator(PermissionEvaluator permissionEvaluator) {
this.expressionHandler.setPermissionEvaluator(permissionEvaluator);
}
Context
I've switched from the @EnableGlobalMethodSecurity
annotation to the @EnableMethodSecurity
annotation and this caused the existing permission evaluator not to be applied to @PreAuthorize
annotations for methods.
There is of course a way to fix that easily by defining a custom expression handler that utilizes the permission evaluator, but I would've expected that the old way of the @EnableGlobalMethodSecurity
using the existing permission evaluator should also work with the new annotation without defining additional beans.
But maybe this was a conscious decision or I'm simply missing something.
Thanks in advance for taking a look.