title: Sonata Admin: How to remove "Add New" button from dashboard only?
body: <p>I'm using Symfony 2.7 with Sonata Admin Bundle to manage some products and product images. I used the Sonata Admin Cookbook recipe: <a href="https://sonata-project.org/bundles/admin/master/doc/cookbook/recipe_file_uploads.html" rel="noreferrer">https://sonata-project.org/bundles/admin/master/doc/cookbook/recipe_file_uploads.html</a> for images.</p>
  
  <p>Because an image must have a product id associated with it, I want to disable the "Add New" Image link from the Sonata admin dashboard and from the top toolbar, so any uploaded image will have an associated product. Actually the only place where images should be allowed to be added is in the product add/edit page.</p>
  
  <p>I've tried to remove the route like this, according to some answers found here: <a href="https://stackoverflow.com/questions/9587431/sonata-admin-dashboard-configure-actions-per-entity">Sonata Admin Dashboard: configure actions per entity</a></p>
  
  <pre><code>protected function configureRoutes(RouteCollection $collection)
  {
      $container = $this-&gt;getConfigurationPool()-&gt;getContainer(); 
  
      if ($container-&gt;get('request')-&gt;get('_route') == 'sonata_admin_dashboard') {
          $collection-&gt;remove('create');
      }
  }
  </code></pre>
  
  <p>But this solution is not good, because, if the cache is initialized when I access the admin dashboard, the route gets removed everywhere, but if the cache is initialized on a different page, then the route will be present on all pages, including dashboard, because Sonata Admin validates in templates if the route exists when displaying the link.</p>
  
  <p>So, I need the route to exist and to remove the link. Can this be done using configuration or I have to rewrite the templates?</p>