title: Symfony 2 Access Control to Objects in View
body: <p>In views, I can use </p>
  
  <pre><code>if ($view['security']-&gt;isGranted('ROLE_ADMIN')) :
  </code></pre>
  
  <p>To check if the user has a certain role. But what about objects?</p>
  
  <p>For example: when a user is viewing his/her post, I want to show an edit/delete button</p>