ClickHouse/dbms/src/Interpreters/Users.h

57 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include <Core/Types.h>
#include <Access/Authentication.h>
#include <Access/AllowedClientHosts.h>
2017-03-25 05:55:49 +00:00
#include <memory>
#include <unordered_map>
#include <unordered_set>
2017-03-25 05:55:49 +00:00
namespace Poco
{
namespace Util
{
class AbstractConfiguration;
}
2017-03-25 05:55:49 +00:00
}
2017-03-25 05:55:49 +00:00
namespace DB
{
2017-01-14 02:53:40 +00:00
/** User and ACL.
*/
struct User
{
String name;
/// Required password.
Authentication authentication;
String profile;
AllowedClientHosts allowed_client_hosts;
/// List of allowed databases.
using DatabaseSet = std::unordered_set<std::string>;
2019-11-18 13:35:31 +00:00
std::optional<DatabaseSet> databases;
2015-10-01 15:10:41 +00:00
2019-09-14 22:55:22 +00:00
/// List of allowed dictionaries.
using DictionarySet = std::unordered_set<std::string>;
2019-11-18 13:35:31 +00:00
std::optional<DictionarySet> dictionaries;
/// Table properties.
using PropertyMap = std::unordered_map<std::string /* name */, std::string /* value */>;
using TableMap = std::unordered_map<std::string /* table */, PropertyMap /* properties */>;
using DatabaseMap = std::unordered_map<std::string /* database */, TableMap /* tables */>;
DatabaseMap table_props;
2019-12-01 22:01:05 +00:00
bool is_quota_management_allowed = false;
User(const String & name_, const String & config_elem, const Poco::Util::AbstractConfiguration & config);
};
}