public void show(final String caption, final Consumer<UserRef> userConsumer) {
        initialSelection = getSelected();
        refresh();

        final PopupSize popupSize = PopupSize.resizable(800, 600);
        ShowPopupEvent.builder(this)
                .popupType(PopupType.OK_CANCEL_DIALOG)
                .popupSize(popupSize)
                .caption(caption)
                .onShow(e -> getView().focus())
                .onHideRequest(e -> {
                    if (e.isOk()) {
                        final UserRef selected = getSelected();
                        selectionChangeConsumer.accept(selected);
                        userConsumer.accept(selected);
                        e.hide();
                    } else {
                        selectionChangeConsumer.accept(initialSelection);
                        e.hide();
                    }
                })
                .fire();
    }
For selecting a username to add a user to a permissions set or selecting a user to add to a group.
For internal IDP this will list users from account and stroom_user combined.
For external IDP this will list users from stroom_user only and users on the IDP but not in
stroom_user will have to be manually added to the list.
stroom-core-client/src/main/java/stroom/security/client/presenter/UserRefPopupPresenter.java