ClickHouse/src/Access/EnabledRolesInfo.h

31 lines
856 B
C++
Raw Normal View History

2020-02-21 00:17:07 +00:00
#pragma once
#include <Access/AccessRights.h>
#include <Access/SettingsProfileElement.h>
2020-02-21 00:17:07 +00:00
#include <Core/UUID.h>
#include <boost/container/flat_set.hpp>
2020-02-21 00:17:07 +00:00
#include <unordered_map>
namespace DB
{
/// Information about a role.
struct EnabledRolesInfo
2020-02-21 00:17:07 +00:00
{
boost::container::flat_set<UUID> current_roles;
boost::container::flat_set<UUID> enabled_roles;
boost::container::flat_set<UUID> enabled_roles_with_admin_option;
2020-02-21 00:17:07 +00:00
std::unordered_map<UUID, String> names_of_roles;
AccessRights access;
SettingsProfileElements settings_from_enabled_roles;
2020-02-21 00:17:07 +00:00
Strings getCurrentRolesNames() const;
Strings getEnabledRolesNames() const;
friend bool operator ==(const EnabledRolesInfo & lhs, const EnabledRolesInfo & rhs);
friend bool operator !=(const EnabledRolesInfo & lhs, const EnabledRolesInfo & rhs) { return !(lhs == rhs); }
2020-02-21 00:17:07 +00:00
};
}