public function removeRoleAssignment(RoleAssignment $roleAssignment)
{
if ($this->repository->canUser('role', 'assign', $roleAssignment) !== true) {
throw new UnauthorizedException('role', 'assign');
}
$spiRoleAssignment = $this->userHandler->loadRoleAssignment($roleAssignment->id);
$this->repository->beginTransaction();
try {
$this->userHandler->removeRoleAssignment($spiRoleAssignment->id);
$this->repository->commit();
} catch (Exception $e) {
$this->repository->rollback();
throw $e;
}
}