#pragma once #include #include #include #include #include #include #include namespace DB { /** User and ACL. */ struct User : public IAccessEntity { std::vector authentication_methods; 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; 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; bool hasDependencies(const std::unordered_set & ids) const override; void replaceDependencies(const std::unordered_map & old_to_new_ids) override; void copyDependenciesFrom(const IAccessEntity & src, const std::unordered_set & ids) override; void removeDependencies(const std::unordered_set & ids) override; void clearAllExceptDependencies() override; bool isBackupAllowed() const override { return settings.isBackupAllowed(); } }; using UserPtr = std::shared_ptr; }