title: symfony2 access denied exception
body: <p>i'm working on symfony2 project and i get this exception. anybody have an idea on what is causing it ?</p>
  
  <p>Uncaught exception 'Symfony\Component\Security\Core\Exception\AccessDeniedException' with message 'Access Denied' in /data/apache/www/emploipublic-sf/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AccessListener.php:70\n</p>
  
  <pre><code>class AccessListener implements ListenerInterface
  {  
  private $context;
  private $accessDecisionManager;
  private $map;
  private $authManager;
  private $logger;
  
  public function __construct(SecurityContextInterface $context, AccessDecisionManagerInterface $accessDecisionManager, AccessMapInterface $map, AuthenticationManagerInterface $authManager, LoggerInterface $logger = null)
  {
      $this-&gt;context = $context;
      $this-&gt;accessDecisionManager = $accessDecisionManager;
      $this-&gt;map = $map;
      $this-&gt;authManager = $authManager;
      $this-&gt;logger = $logger;
  }
  
  /**
   * Handles access authorization.
   *
   * @param GetResponseEvent $event A GetResponseEvent instance
   */
  public function handle(GetResponseEvent $event)
  {
      if (null === $token = $this-&gt;context-&gt;getToken()) {
          throw new AuthenticationCredentialsNotFoundException('A Token was not found in the SecurityContext.');
      }
  
      $request = $event-&gt;getRequest();
  
      list($attributes, $channel) = $this-&gt;map-&gt;getPatterns($request);
  
      if (null === $attributes) {
          return;
      }
  
      if (!$token-&gt;isAuthenticated()) {
          $token = $this-&gt;authManager-&gt;authenticate($token);
          $this-&gt;context-&gt;setToken($token);
      }
  
      if (!$this-&gt;accessDecisionManager-&gt;decide($token, $attributes, $request)) {
          throw new AccessDeniedException();  // this is line 70
      }
  }
  }
  </code></pre>