#include <libfilezilla/glue/wx.hpp>

#include "../filezilla/authentication/file_based_authenticator.hpp"
#include "../filezilla/authentication/system_identity_provider.hpp"

#include "userslist.hpp"

#include "locale.hpp"

bool UsersList::is_item_allowed(const users::value_type &v)
{
	if (is_name_allowed(v.first)) {
		return true;
	}

	if (fz::authentication::file_based_authenticator::is_idp_user(v)) {
		if (v.second.identity->idp == fz::authentication::system_identity_provider::name) {
			return true;
		}
	}

	return false;
}

UsersList::UsersList(wxWindow *parent)
	: MappedItemListManager(parent, "New User", _S("Available users"))
{
}
