title: How to make @PreAuthorize having higher precedence than @Valid or @Validated
body: <p>I am using spring boot, and I have enabled the global method security in WebSecurityConfigurerAdapter by </p>
  
  <pre><code>@EnableGlobalMethodSecurity(prePostEnabled = true, order = Ordered.HIGHEST_PRECEDENCE) 
  </code></pre>
  
  <p>And Below is my controller code</p>
  
  <pre><code>@PreAuthorize("hasAnyRole('admin') or principal.id == id")
  @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
  public User updateUser(@PathVariable("id") String id,  @Valid @RequestBody   UserDto userDto) 
  { ....}
  </code></pre>
  
  <p>However, when a non-admin user try to do a PUT request, the JSR303 validator will kick in before @PreAuthorize. 
  For example, non-admin user ended up getting something like "first name is required" instead of "access denied". But after user supplied the first name variable to pass the validator, access denied was returned.</p>
  
  <p>Does anyone know how to enforce the @PreAuthorize get checked before @Valid or @Validated? </p>
  
  <p>And I have to use this kind of method-level authorization instead of url-based authorization in order to perform some complex rule checking.</p>