@PreAuthorize not working with prePostEnabled = true
问题 Using @EnableGlobalMethodSecurity(prePostEnabled = true) it seems that @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class WebSecurityConfig extends WebSecurityConfigurerAdapter { } @PreAuthorized has no effect: @PreAuthorize("permitAll()") @RequestMapping(value = "/users/change-email", method = RequestMethod.GET) public void changeEmail() { // .. } I have also moved the annotation into the service layer with the same result: @PreAuthorize(