public function removeRole(Role $role)
{
$this->initializeRoles();
if ($this->hasRole($role)) {
$roleIdentifier = $role->getIdentifier();
unset($this->roles[$roleIdentifier]);
$identifierIndex = array_search($roleIdentifier, $this->roleIdentifiers);
unset($this->roleIdentifiers[$identifierIndex]);
}
}