Add admin password check (#847)

Fixes #846
This commit is contained in:
Sergey Kuznetsov
2023-10-03 17:22:37 +01:00
committed by GitHub
parent e2cc56d25a
commit 0818b6ce5b
22 changed files with 478 additions and 117 deletions

View File

@@ -41,6 +41,7 @@ protected:
public:
std::string const clientIp;
bool upgraded = false;
bool isAdmin_ = false;
/**
* @brief Create a new connection base.
@@ -85,5 +86,16 @@ public:
{
return ec_ != boost::system::error_code{};
}
/**
* @brief Indicates whether the connection has admin privileges
*
* @return true if the connection is from admin user
*/
[[nodiscard]] bool
isAdmin() const
{
return isAdmin_;
}
};
} // namespace web