From d185b7a332c5fd0b7c0bc4040121ef15e0a5fae4 Mon Sep 17 00:00:00 2001 From: Konstantin Morozov Date: Mon, 29 Aug 2022 20:19:20 +0300 Subject: [PATCH] refactoring: public ctors --- src/Access/ContextAccess.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Access/ContextAccess.h b/src/Access/ContextAccess.h index acd1693f72e..331b449125e 100644 --- a/src/Access/ContextAccess.h +++ b/src/Access/ContextAccess.h @@ -69,6 +69,9 @@ public: using Params = ContextAccessParams; const Params & getParams() const { return params; } + ContextAccess() { } /// NOLINT + ContextAccess(const AccessControl & access_control_, const Params & params_); + /// Returns the current user. Throws if user is nullptr. UserPtr getUser() const; /// Same as above, but can return nullptr. @@ -166,27 +169,14 @@ public: template static std::shared_ptr make(Args &&... args) { - return std::make_shared>(std::forward(args)...); + return std::make_shared(std::forward(args)...); } ~ContextAccess(); -protected: - ContextAccess() { } /// NOLINT - ContextAccess(const AccessControl & access_control_, const Params & params_); - private: friend class AccessControl; - template - struct MakeSharedHelper : public T - { - template - explicit MakeSharedHelper(Args &&... args) : T(std::forward(args)...) - { - } - }; - void initialize(); void setUser(const UserPtr & user_) const; void setRolesInfo(const std::shared_ptr & roles_info_) const;