title: Custom Error message with @Preauthorize and @@ControllerAdvice
body: <p>We are using spring and spring-security-3.2. Recently We are adding annotations @PreAuthorize to RestAPIs(earlier it was URL based).</p>
  
  <pre><code>     @PreAuthorize("hasPermission('salesorder','ViewSalesOrder')")
    @RequestMapping(value = "/restapi/salesorders/", method = RequestMethod.GET)
    public ModelAndView getSalesOrders(){}
  </code></pre>
  
  <p>We already have Global exception handler which annotated with - @ControllerAdvice and custom PermissionEvaluator in place, everything works fine except the error message.</p>
  
  <p>Lets say some user is accessing API At moment without having 'ViewSalesOrder' permission then spring by default throws the exception 'Access is denied',but didn't tell which permission is missing (Its our requirement to mention which permission is missing).</p>
  
  <p>Is it possible to throw an exception which also include the permission name, so final error message should be look like "Access is denied, you need ViewSalesOrder permission"(here permission name should be from @PreAuthorize annotation)?</p>
  
  <p>Please note that we have 100 such restAPI in place so generic solution will be highly appreciated.</p>