spring not enforcing method security annotations

后端 未结 7 1126
心在旅途
心在旅途 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:29

    In my case, the exact location of this statement:

    
    

    proved to be very important. Make sure that you put it after you declare which classes should be scanned and used as controllers.

    
    

    This is the way to make sure that the @Secured annotations will also get into the game

提交回复
热议问题