#pragma once #include namespace Poco { namespace Util { class AbstractConfiguration; } } namespace DB { /// Implementation of IAccessStorage which loads all from users.xml periodically. class UsersConfigAccessStorage : public IAccessStorage { public: UsersConfigAccessStorage(); ~UsersConfigAccessStorage() override; void loadFromConfig(const Poco::Util::AbstractConfiguration & config); private: std::optional findImpl(std::type_index type, const String & name) const override; std::vector findAllImpl(std::type_index type) const override; bool existsImpl(const UUID & id) const override; AccessEntityPtr readImpl(const UUID & id) const override; String readNameImpl(const UUID & id) const override; bool canInsertImpl(const AccessEntityPtr &) const override { return false; } UUID insertImpl(const AccessEntityPtr & entity, bool replace_if_exists) override; void removeImpl(const UUID & id) override; void updateImpl(const UUID & id, const UpdateFunc & update_func) override; ext::scope_guard subscribeForChangesImpl(const UUID & id, const OnChangedHandler & handler) const override; ext::scope_guard subscribeForChangesImpl(std::type_index type, const OnChangedHandler & handler) const override; bool hasSubscriptionImpl(const UUID & id) const override; bool hasSubscriptionImpl(std::type_index type) const override; MemoryAccessStorage memory_storage; }; }