2020-02-21 00:17:07 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Access/AccessRights.h>
|
2020-03-04 22:27:03 +00:00
|
|
|
#include <Access/SettingsProfileElement.h>
|
2020-02-21 00:17:07 +00:00
|
|
|
#include <Core/UUID.h>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Information about a role.
|
2020-03-07 17:37:38 +00:00
|
|
|
struct EnabledRolesInfo
|
2020-02-21 00:17:07 +00:00
|
|
|
{
|
|
|
|
std::vector<UUID> current_roles;
|
|
|
|
std::vector<UUID> enabled_roles;
|
|
|
|
std::vector<UUID> enabled_roles_with_admin_option;
|
|
|
|
std::unordered_map<UUID, String> names_of_roles;
|
|
|
|
AccessRights access;
|
|
|
|
AccessRights access_with_grant_option;
|
2020-03-04 22:27:03 +00:00
|
|
|
SettingsProfileElements settings_from_enabled_roles;
|
2020-02-21 00:17:07 +00:00
|
|
|
|
|
|
|
Strings getCurrentRolesNames() const;
|
|
|
|
Strings getEnabledRolesNames() const;
|
|
|
|
|
2020-03-07 17:37:38 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
}
|