title: symfony2: check user permission with isGranted
body: <p>In the class
  vendor\friendsofsymfony\user-bundle\Model\User.php it's said that </p>
  
  <pre><code>/**
   * Never use this to check if this user has access to anything!
   *
   * Use the SecurityContext, or an implementation of AccessDecisionManager
   * instead, e.g.
   *
   *         $securityContext-&gt;isGranted('ROLE_USER');
   *
   * @param string $role
   *
   * @return boolean
   */
  public function hasRole($role)
  {
      return in_array(strtoupper($role), $this-&gt;getRoles(), true);
  }
  </code></pre>
  
  <p>but  isGranted return the role on actual user</p>
  
  <pre><code>        $data = $form-&gt;getData();
          $user = new User();
          $user-&gt;setUsername($data-&gt;getUsername());
          $user-&gt;setExpiresAt($data-&gt;getExpiresAt());
          $user-&gt;setName($data-&gt;getName());
          $user-&gt;setPassword($data-&gt;getPassword());
          $user-&gt;setEmail($data-&gt;getEmail());
          $user-&gt;setCredentialsExpired($data-&gt;isCredentialsExpired());
          $user-&gt;setRoles(array('ROLE_NEW'));
          $em-&gt;persist($user);
          $em-&gt;flush();
          // return false
          var_dump(
          $this-&gt;get('security.context')&gt;isGranted('ROLE_NEW',$user));
  </code></pre>
  
  <p>how do i check "isGranted" for a specific user ?  </p>