title: getRoles() ignored in Symfony2
body: <p>My security yml is as follow</p>
  
  <pre><code>security:
      encoders:
          FOS\UserBundle\Model\UserInterface: sha512
  
      role_hierarchy:
          ROLE_USER:        ROLE_MEMBER
          ROLE_ADMIN:       ROLE_USER
          ROLE_SUPER_ADMIN: ROLE_ADMIN
  
      providers:
          fos_userbundle:
              id: fos_user.user_provider.username
  
      firewalls:
          main:
              pattern: ^/
              form_login:
                  provider: fos_userbundle
                  csrf_provider: form.csrf_provider
              logout:
                  path:   /logout
                  target: /
                  invalidate_session: false
              anonymous:    true
  
      access_control:
          - { path: ^/login$,     role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/register,   role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/resetting,  role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/profile,    role: ROLE_MEMBER }
          - { path: ^/admin,      role: ROLE_ADMIN }
          - { path: ^/group,      role: ROLE_ADMIN }
  </code></pre>
  
  <p>I have simply added a new role called <code>ROLE_MEMBER</code> and allowed only it to access the profile route.</p>
  
  <p>If profile is set to <code>ROLE_USER</code> then this works fine.</p>
  
  <p>I am using the FOSUserBundle, I have a fos_group and fos_user_group table. The joining table as an example is below.</p>
  
  <p><img src="https://i.stack.imgur.com/Q4HX3.png" alt="fos_user_group"></p>
  
  <p>I have successfully used this table to give a user the member group, the roles for that group are just <code>ROLE_MEMBER</code>.</p>
  
  <p>Using the following code within a controller I can see that a user has the roles of <code>ROLE_MEMBER</code> and <code>ROLE_USER</code>. </p>
  
  <pre><code>$user  = $this-&gt;getUser();
  $user-&gt;getRoles();
  </code></pre>
  
  <p>This returns;</p>
  
  <pre><code>array(2) { [0]=&gt; string(11) "ROLE_MEMBER" [1]=&gt; string(9) "ROLE_USER" } 
  </code></pre>
  
  <p>This is correct, I think. Yet the profile is inaccessible. If I change the profile to require <code>ROLE_USER</code> then it works and it can be accessed. The interesting thing is that using the debug section of Symfony I can see that in fact my user does not have the member role.</p>
  
  <p><img src="https://i.stack.imgur.com/nCGoR.png" alt="no member role"></p>
  
  <p>Is there a step I have missed that tells Symfony of the roles I have assigned my user, it seems that ensuring <code>getRoles()</code> returns the correct array does not work as I expected.</p>