2013-08-10 07:46:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-01-26 09:49:53 +00:00
|
|
|
#include <Access/IAccessEntity.h>
|
2020-06-20 22:44:52 +00:00
|
|
|
#include <Access/AccessRights.h>
|
2023-04-24 15:12:45 +00:00
|
|
|
#include <Access/AuthenticationData.h>
|
2021-10-31 08:51:20 +00:00
|
|
|
#include <Access/Common/AllowedClientHosts.h>
|
2020-04-20 22:07:00 +00:00
|
|
|
#include <Access/GrantedRoles.h>
|
2020-05-30 20:10:45 +00:00
|
|
|
#include <Access/RolesOrUsersSet.h>
|
2020-03-04 22:27:03 +00:00
|
|
|
#include <Access/SettingsProfileElement.h>
|
2013-08-10 07:46:45 +00:00
|
|
|
|
|
|
|
|
2017-03-25 05:55:49 +00:00
|
|
|
namespace DB
|
2013-08-10 07:46:45 +00:00
|
|
|
{
|
2017-01-14 02:53:40 +00:00
|
|
|
/** User and ACL.
|
2013-08-10 07:46:45 +00:00
|
|
|
*/
|
2020-01-26 09:49:53 +00:00
|
|
|
struct User : public IAccessEntity
|
2013-08-10 07:46:45 +00:00
|
|
|
{
|
2021-11-01 14:03:20 +00:00
|
|
|
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;
|
2020-04-20 22:07:00 +00:00
|
|
|
GrantedRoles granted_roles;
|
2020-05-30 20:10:45 +00:00
|
|
|
RolesOrUsersSet default_roles = RolesOrUsersSet::AllTag{};
|
2020-03-04 22:27:03 +00:00
|
|
|
SettingsProfileElements settings;
|
2021-03-11 13:44:00 +00:00
|
|
|
RolesOrUsersSet grantees = RolesOrUsersSet::AllTag{};
|
2021-07-05 16:55:07 +00:00
|
|
|
String default_database;
|
2023-06-22 01:35:11 +00:00
|
|
|
time_t valid_until = 0;
|
2020-01-12 21:00:55 +00:00
|
|
|
|
2020-01-26 09:49:53 +00:00
|
|
|
bool equal(const IAccessEntity & other) const override;
|
|
|
|
std::shared_ptr<IAccessEntity> clone() const override { return cloneImpl<User>(); }
|
2021-11-18 20:54:18 +00:00
|
|
|
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;
|
2022-06-15 18:25:13 +00:00
|
|
|
|
|
|
|
std::vector<UUID> findDependencies() const override;
|
|
|
|
void replaceDependencies(const std::unordered_map<UUID, UUID> & old_to_new_ids) override;
|
2022-06-19 10:49:50 +00:00
|
|
|
bool isBackupAllowed() const override { return settings.isBackupAllowed(); }
|
2013-08-10 07:46:45 +00:00
|
|
|
};
|
|
|
|
|
2020-01-26 09:49:53 +00:00
|
|
|
using UserPtr = std::shared_ptr<const User>;
|
2013-08-10 07:46:45 +00:00
|
|
|
}
|