kolorobot / spring-mvc-quickstart-archetype

The project is a Maven archetype for Spring MVC web application.
http://blog.codeleak.pl
1.05k stars 478 forks source link

@Secured annotation doesnt works (at least on controllers). #94

Closed MarcinMilewski closed 8 years ago

MarcinMilewski commented 8 years ago

The @Secured annotation doesn't work on controllers for me. I have been tested it with @EnableGlobalMethodSecurity(securedEnabled = true) also and configuration like here: http://stackoverflow.com/questions/24865588/how-to-enable-secured-annotations-with-java-based-configuration . I attached I think pretty nice explanation why.

http://stackoverflow.com/questions/3087548/can-spring-security-use-preauthorize-on-spring-controllers-methods

http://docs.spring.io/spring-security/site/docs/3.2.x/reference/htmlsingle/faq.html#faq-method-security-in-web-context

kolorobot commented 8 years ago

To be investigated. Thanks.

kolorobot commented 8 years ago

@MarcinMilewski Fixed. Added new method. Of course I made some preparation before this commit to simplify the configuration (after your feedback, so thanks!)