ClickHouse/src/Access/User.h

40 lines
1.3 KiB
C++
Raw Normal View History

#pragma once
#include <Access/IAccessEntity.h>
2020-06-20 22:44:52 +00:00
#include <Access/AccessRights.h>
#include <Access/Common/AuthenticationData.h>
#include <Access/Common/AllowedClientHosts.h>
#include <Access/GrantedRoles.h>
#include <Access/RolesOrUsersSet.h>
#include <Access/SettingsProfileElement.h>
2017-03-25 05:55:49 +00:00
namespace DB
{
2017-01-14 02:53:40 +00:00
/** User and ACL.
*/
struct User : public IAccessEntity
{
AuthenticationData auth_data;
2020-02-21 00:17:07 +00:00
AllowedClientHosts allowed_client_hosts = AllowedClientHosts::AnyHostTag{};
2020-06-20 22:44:52 +00:00
AccessRights access;
GrantedRoles granted_roles;
RolesOrUsersSet default_roles = RolesOrUsersSet::AllTag{};
SettingsProfileElements settings;
RolesOrUsersSet grantees = RolesOrUsersSet::AllTag{};
2021-07-05 16:55:07 +00:00
String default_database;
2020-01-12 21:00:55 +00:00
bool equal(const IAccessEntity & other) const override;
std::shared_ptr<IAccessEntity> clone() const override { return cloneImpl<User>(); }
static constexpr const auto TYPE = AccessEntityType::USER;
AccessEntityType getType() const override { return TYPE; }
2022-05-24 12:24:03 +00:00
void setName(const String & name_) override;
std::vector<UUID> findDependencies() const override;
void replaceDependencies(const std::unordered_map<UUID, UUID> & old_to_new_ids) override;
bool isBackupAllowed() const override { return settings.isBackupAllowed(); }
};
using UserPtr = std::shared_ptr<const User>;
}