title: how to check the user role inside form builder in Symfony2?
body: <p>Okay, i'm trying to check if an user has a specific role, i did <a href="https://stackoverflow.com/questions/11998761/how-can-i-access-the-user-role-in-form-builder-class-in-symfony2">this</a></p>
  
  <p>however, when i do this:</p>
  
  <pre><code>public function buildForm(FormBuilder $builder, array $options)
  {
      $builder
          -&gt;add('nombre',null,array('label' =&gt; 'Usuario'))
          -&gt;add('email')
          -&gt;add('password', 'repeated', array(
              'type' =&gt; 'password',
              'invalid_message' =&gt; 'Los campos deben coincidir',
              'first_name' =&gt; 'password',
              'second_name' =&gt; 'confirmar password',
              'options' =&gt; array('required' =&gt; false)
              ))
  
          -&gt;add('cliente', 'entity', array(
          'class' =&gt; 'ClientesBundle:Cliente',
          'empty_value' =&gt; 'Company',            
          'required'    =&gt; false,
          'empty_data'  =&gt; null)
      **)**
        $user = $this-&gt;securityContext-&gt;getToken()-&gt;getUser();
        **if ($user-&gt;getRol() == 'ROLE_SUPER_ADMIN'){**
          -&gt;add('rol') 
          **}**
      ;
  
  }
  </code></pre>
  
  <p>tried this as well:</p>
  
  <pre><code> **if ($this-&gt;securityContext-&gt;getToken()-&gt;getUser()-&gt;getRol() === 'ROLE_SUPER_ADMIN'){**
              -&gt;add('rol') 
              **}**
  </code></pre>
  
  <p>the bolded lines (the ones with **) have the tiny red line that indicates an error, and it's says unexpected if...
  How do i fix this?</p>