sonata-project/SonataUserBundle — pull request #223 by eko (2013-05-06 07:56:52+00:00)
Title: Add a real roles method because of FOSUserBundle

### Reason:
`FOS\UserBundle\Model\User` model is merging user's groups roles in `getRoles()` method:

```php
/**
* Returns the user roles
*
* @return array The roles
*/
public function getRoles()
{
$roles = $this->roles;

foreach ($this->getGroups() as $group) {
$roles = array_merge($roles, $group->getRoles());
}

// we need to make sure to have at least one role
$roles[] = static::ROLE_DEFAULT;

return array_unique($roles);
}
```

So when `UserAdmin` calls `getRoles()` method to display admin form (when editing a user), user's groups roles are checked too.

### Solution:
A `getRealRoles()` method has been added to `Sonata\UserBundle\Model\User` model and is now used into `UserAdmin` class.