mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 06:01:57 +00:00
30 lines
641 B
C++
30 lines
641 B
C++
|
#pragma once
|
||
|
|
||
|
#include <Interpreters/ISecurityManager.h>
|
||
|
|
||
|
#include <map>
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
class SecurityManager : public ISecurityManager
|
||
|
{
|
||
|
private:
|
||
|
using Container = std::map<String, User>;
|
||
|
Container users;
|
||
|
|
||
|
public:
|
||
|
void loadFromConfig(Poco::Util::AbstractConfiguration & config) override;
|
||
|
|
||
|
const User & authorizeAndGetUser(
|
||
|
const String & user_name,
|
||
|
const String & password,
|
||
|
const Poco::Net::IPAddress & address) const override;
|
||
|
|
||
|
const User & getUser(const String & user_name) override;
|
||
|
|
||
|
bool hasAccessToDatabase(const String & user_name, const String & database_name) const override;
|
||
|
};
|
||
|
|
||
|
}
|