title: Symfony2: How to hide link in Twig based on permissions
body: <p>My application shows a list of projects, project detail pages and forms to edit these projects. These are the routes:</p>
  
  <ul>
  <li>/ - list of projects</li>
  <li>/project/42 - view project (project detail page)</li>
  <li>/project/42/edit - edit project</li>
  </ul>
  
  <p>Only its owner may edit a project. </p>
  
  <p>I have implemented a Voter to prevent access to /project/42/edit for non-owners.</p>
  
  <p>Now, I also want to hide the link "edit project" from the project detail page. What would be the way to do this? Ideally, in Twig, I would like to do something like</p>
  
  <pre>
  {% if may_access(path('project_edit', { 'id': project.id })) %}
    &lt;a href="{{ path('project_edit', { 'id': project.id }) }}">edit project&lt;/a>
  {% endif %}
  </pre>
  
  <p>I can implement this function as a Twig extension, but maybe a similar functionality already exists.</p>