spring not enforcing method security annotations

后端 未结 7 1198
心在旅途
心在旅途 2021-01-01 20:05

I\'m some what lost as to why spring isn\'t enforcing the @Secured(\"ROLE_USER\") on my service interface. My controllers are established using annotations.

An exam

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-01 20:33

    Do you have the statement

    
    

    in the same configuration file as the one you defined the MyServiceManager bean? I had the same problem until I turned on debug for org.springframework, and noticed that spring security was only applied on the same file as the ones where global-method-security was defined in.

提交回复
热议问题