2020-02-04 22:37:04 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/IInterpreter.h>
|
|
|
|
#include <Parsers/IAST_fwd.h>
|
2020-02-21 19:27:12 +00:00
|
|
|
#include <Core/UUID.h>
|
2020-02-04 22:37:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-02-21 19:27:12 +00:00
|
|
|
class ASTGrantQuery;
|
|
|
|
struct User;
|
|
|
|
struct Role;
|
|
|
|
|
|
|
|
|
2020-02-04 22:37:04 +00:00
|
|
|
class InterpreterGrantQuery : public IInterpreter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
InterpreterGrantQuery(const ASTPtr & query_ptr_, Context & context_) : query_ptr(query_ptr_), context(context_) {}
|
|
|
|
|
|
|
|
BlockIO execute() override;
|
|
|
|
|
2020-02-21 19:27:12 +00:00
|
|
|
static void updateUserFromQuery(User & user, const ASTGrantQuery & query);
|
|
|
|
static void updateRoleFromQuery(Role & role, const ASTGrantQuery & query);
|
2021-02-23 10:30:15 +00:00
|
|
|
void extendQueryLogElemImpl(QueryLogElement &, const ASTPtr &, const Context &) const override;
|
2020-02-21 19:27:12 +00:00
|
|
|
|
2020-02-04 22:37:04 +00:00
|
|
|
private:
|
|
|
|
ASTPtr query_ptr;
|
|
|
|
Context & context;
|
|
|
|
};
|
|
|
|
}
|