title: spring security @PreAuthorize not blocking requests
body: <p><strong>Configuration</strong></p>
  
  <pre><code>@Configuration
  @EnableGlobalMethodSecurity(prePostEnabled=true)
  public class MethodSecurityConfig extends GlobalMethodSecurityConfiguration{
  
      @Override
      protected AuthenticationManager authenticationManager() throws Exception {
          return super.authenticationManager();
      }
  }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>    @RequestMapping(value="/events/eventsToApprove", method=RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE)
      @ResponseBody
      @PreAuthorize("hasRole('ROLE_LEAD')")
      public List&lt;Event&gt; eventsToApprove(@RequestParam("user") String username){
          CustomUser user= (CustomUser) userService.loadUserByUsername(username);
          if(user!=null){
              return eventService.getEventsToApprove(user);
          }
          return null;
      }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Unexpected AOP exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in com.tracker.config.MethodSecurityConfig: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An AuthenticationManager is required
  </code></pre>
  
  <p>I am using @preauthorize on the above controller to allow only users with "ROLE_LEAD". but it's not working. Every request is coming in. Anything wrong in configiration</p>
  
  <p>Thanks</p>