#pragma once #include #include #include #include #include #include #include namespace DB { /** User and ACL. */ struct User : public IAccessEntity { AuthenticationData auth_data; AllowedClientHosts allowed_client_hosts = AllowedClientHosts::AnyHostTag{}; AccessRights access; GrantedRoles granted_roles; RolesOrUsersSet default_roles = RolesOrUsersSet::AllTag{}; SettingsProfileElements settings; RolesOrUsersSet grantees = RolesOrUsersSet::AllTag{}; String default_database; time_t valid_until = 0; bool equal(const IAccessEntity & other) const override; std::shared_ptr clone() const override { return cloneImpl(); } static constexpr const auto TYPE = AccessEntityType::USER; AccessEntityType getType() const override { return TYPE; } void setName(const String & name_) override; std::vector findDependencies() const override; void replaceDependencies(const std::unordered_map & old_to_new_ids) override; bool isBackupAllowed() const override { return settings.isBackupAllowed(); } }; using UserPtr = std::shared_ptr; }