-
Notifications
You must be signed in to change notification settings - Fork 703
Closed
Description
Patrice Blanchardie opened DATACMNS-1518 and commented
As explained in https://stackoverflow.com/questions/35486538/how-to-user-hasanyrole-like-expression-spel-in-query, we're not able to use hasAnyRole/hasAnyAuthority.
org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 0): Method call: Method hasAnyRole(java.lang.String,java.lang.String) cannot be found on java.lang.Object[] type
at org.springframework.expression.spel.ast.MethodReference.findAccessorForMethoThe ExtensionAwareEvaluationContextProvider MethodResolver doesn't match hasAnyRole(String[]), and the ReflectiveMethodResolver has a weird targetObject so its doesn't find anything.
When used elsewhere (eg. in @PreAuthorize anotations, only ReflectiveMethodResolver is used with targetObject MethodSecurityExpressionRoot, and the method is properly resolved
Affects: 2.0.14 (Kay SR14), 2.1.6 (Lovelace SR6), 2.2 M3 (Moore), 1.13.20 (Ingalls SR20)
Backported to: 2.1.7 (Lovelace SR7)
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug