title: SonataUser - Custom voter not called for LIST
body: <p>In Sonata User Admin, I wanted to give users the ability to list/edit only users belonging to the same company.</p>
  
  <p>So I have implemented a custom voter to manage this specific security rule on User Admin:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function supportsAttribute($attribute) 
  {
     return in_array($attribute, array(
        'EDIT',
        'DELETE',
        'VIEW',
        'LIST',
     ));
  }
  
  public function supportsClass($class)
  {
      return in_array("FOS\UserBundle\Model\UserInterface"
        , class_implements($class));
  }
  
  public function vote(TokenInterface $token, $object, array $attributes) 
  {
      if ( !($this-&gt;supportsClass(get_class($object))) ) {
          return VoterInterface::ACCESS_ABSTAIN;
      }
  
      foreach ($attributes as $attribute) {
          if ( !$this-&gt;supportsAttribute($attribute) ) {
              return VoterInterface::ACCESS_ABSTAIN;
          }
      }
  
      $user = $token-&gt;getUser();
      if ( !($user instanceof UserInterface) ) {
          return VoterInterface::ACCESS_DENIED;
      }
  
      // check if the user has the same company
      if ($user-&gt;getCompany() == $object-&gt;getCompany()) {
          return VoterInterface::ACCESS_GRANTED;
      }
  
      return VoterInterface::ACCESS_DENIED;
  }
  </code></pre>
  
  <p>Now, as a user, I can only modify users attached my company (as expected)<br>
  but I still see all users in the list.</p>
  
  <p><img src="https://i.stack.imgur.com/TzB8v.png" alt="Sonata User Admin Grid"></p>
  
  <p><em>trutruc</em> &amp; <em>machin</em> are from the same company so I can edit them. But I would like <em>chouchouette</em> &amp; <em>truc</em> not to appear. Do I have to override the admin class' <code>createQuery()</code> method in addition to the voter ?</p>
  
  <p>Finally the question is: <strong>How to filter sonata users using ACL ?</strong></p>