title: Sonata Admin Bundle remove routeCollection roles
body: <p>I'm using Sonata Admin Bundle and I'm having some troubles with the function:</p>
  
  <pre><code>function configureRoutes(RouteCollection $collection){ }
  </code></pre>
  
  <p>The function works correctly if I write a simple:</p>
  
  <pre><code>$collection-&gt;remove('create');
  </code></pre>
  
  <p>But what I'm triying to do is to remove some routes depending on the role of the user connected, so I tried:</p>
  
  <pre><code>$seguridad = $this-&gt;getConfigurationPool()-&gt;getContainer()-&gt;get('security.context');
  if ($seguridad-&gt;getToken()-&gt;getUser() != "anon."){
      if ( !$seguridad-&gt;isGranted('ROLE_ADMIN')  ) {
          $collection-&gt;remove('create');
      }
  }
  </code></pre>
  
  <p>But logged as Admin I get the error:
  An exception has been thrown during the rendering of a template ("Route "admin_sademer_core_MIENTITY_create" does not exist.") in SonataAdminBundle:Block:block_admin_list.html.twig at line 31.</p>
  
  <p>It's like in some moment the Sonata remove the route create I before enter in the dashboard, and then when I enter in the dashboard I try to enter in the route create but the route is already removed. But I'm not sure what is happening.</p>
  
  <p>Any idea? Thanks a lot!</p>