public function addRoleCommand($username, $role, $authenticationProvider = null)
    {
        $users = $this->findUsersByUsernamePattern($username, $authenticationProvider);
        if (empty($users)) {
            $this->outputLine('No users that match name-pattern "%s" do exist.', [$username]);
            $this->quit(1);
        }

        foreach ($users as $user) {
            $username = $this->userService->getUsername($user, $authenticationProvider);
            try {
                if ($this->userService->addRoleToUser($user, $role) > 0) {
                    $this->outputLine('Added role "%s" to accounts of user "%s".', [$role, $username]);
                } else {
                    $this->outputLine('User "%s" already had the role "%s" assigned.', [$username, $role]);
                }
            } catch (NoSuchRoleException $exception) {
                $this->outputLine('The role "%s" does not exist.', [$role]);
                $this->quit(2);
            }
        }
    }