Securing controller method with @RolesAllowed and @PreAuthorize

前端 未结 2 1186
感动是毒
感动是毒 2020-12-11 23:38

I\'ve been banging my head over this one for a while now. I\'ve done everything I could in order to find an appropriate solution and followed a lot of Stackoverflow examples

2条回答
  •  無奈伤痛
    2020-12-11 23:48

    Two things I noticed (as mentioned on this thread):

    1. prePostEnabled in the annotation to enable Pre/Post annotations
    2. use of CGLib proxies (Serge mentioned this too)

    Does your @EnableGlobalMethodSecurity have those two attributes?

    @EnableGlobalMethodSecurity(prePostEnabled = true, proxyTargetClass = true)
    

提交回复
热议问题