title: Symfony disable form fields depending on user rol
body: <p>I'm developing an app in symfony for follow the workflow of a document. In the lifecycle of the document, take part various departments, I mean, people of each department with his own role inside de app (<code>ROLE_USER</code>, <code>ROLE_SYSTEMS</code>...). I have the same form for all of them but in the different states of the lifecycle of the document one of them has to complete specific fields and the rest will be disable or readonly.</p>
  
  <p>I want to know how is the best way to do this in Symfony, check the role and disable the fileds the user can't edit in every moment of the lifecycle.</p>
  
  <p>I have investigated and find something like this for my twig templates, but I will have to do this for each field and each role and I don't know if I can apply this to field attributes like disabled or readonly, is it?.</p>
  
  <pre><code>{{% if is_granted('ROLE_ADMIN') %}
      &lt;a href="..."&gt;Delete&lt;/a&gt;
  {% endif %}
  </code></pre>
  
  <p>I also heard about voters but I don't have very clear how it works and if it is appropriate for my situation.</p>
  
  <p>What do you think?</p>