title: How to create a form to edit user roles with FriendsOfSymfony UserBundle
body: <p>I'm trying to create a controller where I can edit the roles of a user (just that, nothing else) and I'm king of stuck.</p>
  
  <p>I've created a form type:</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add(
              'roles', 'choice', [
                  'choices' =&gt; ['ROLE_ADMIN', 'ROLE_USER', 'ROLE_CUSTOMER'],
                  'expanded' =&gt; true,
                  'multiple' =&gt; true,
              ]
          )
          -&gt;add('send', 'submit');
  }
  </code></pre>
  
  <p>First, what would be the best way to retrieve the roles? Is there any way to associate a label to them?</p>
  
  <p>In the controller I have this:</p>
  
  <pre><code>/**
       * User role edition
       *
       * @Route(
       *      path="/edit-roles",
       *      name = "backoffice_user_edit_roles",
       *      requirements = {
       *          "id_user" = "\d*",
       *      },
       *      methods = {"GET"}
       * )
       *
       * @Security("has_role('ROLE_ADMIN')")
       *
       * @Template
       */
      public function editRolesAction($id_user)
      {
          $user = $this-&gt;user_repository-&gt;findOneById($id_user);
          $form = $this-&gt;form_factory-&gt;create('dirital_user_roles_form_type', $user);
          return [
              'form' =&gt; $form-&gt;createView(),
              'user' =&gt; $user
          ];
      }
  </code></pre>
  
  <p>Problems that I have:</p>
  
  <ul>
  <li>The form doesn't get populate with the current user roles, how should I do that?</li>
  <li>When receiving the form, how can I update the user?</li>
  </ul>
  
  <p>Thanks a lot</p>