SpelEvaluationException: EL1004E:(pos 0): Method call: Method hasPermission(java.lang.String) cannot be found on MethodSecurityExpressionRoot type

后端 未结 4 656
隐瞒了意图╮
隐瞒了意图╮ 2020-12-19 18:20

I add to my project a class CustomPermissionEvaluator, configured by a configuration class MethodSecurityConfig, but when I try run my application, after I inform my login c

4条回答
  •  时光取名叫无心
    2020-12-19 19:02

    ... Method hasPermission(java.lang.String) cannot be found ...
    

    The method hasPermission() is called at any time with only one argument, but you provide it with 3 and 4 arguments:

    public boolean hasPermission(Authentication arg0, Object arg1, Object arg2)
    public boolean hasPermission(Authentication arg0, Serializable arg1, String arg2, Object arg3)
    

    Add the method public boolean hasPermission(String permission) and try again.

提交回复
热议问题