mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
495c6e03aa
* Replace all Context references with std::weak_ptr * Fix shared context captured by value * Fix build * Fix Context with named sessions * Fix copy context * Fix gcc build * Merge with master and fix build * Fix gcc-9 build
38 lines
971 B
C++
38 lines
971 B
C++
#pragma once
|
|
|
|
#include <Core/UUID.h>
|
|
#include <Interpreters/IInterpreter.h>
|
|
#include <Parsers/IAST_fwd.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class AccessControlManager;
|
|
class ASTShowGrantsQuery;
|
|
struct IAccessEntity;
|
|
using AccessEntityPtr = std::shared_ptr<const IAccessEntity>;
|
|
|
|
class InterpreterShowGrantsQuery : public IInterpreter, WithContext
|
|
{
|
|
public:
|
|
InterpreterShowGrantsQuery(const ASTPtr & query_ptr_, ContextPtr context_) : WithContext(context_), query_ptr(query_ptr_) {}
|
|
|
|
BlockIO execute() override;
|
|
|
|
static ASTs getGrantQueries(const IAccessEntity & user_or_role, const AccessControlManager & access_control);
|
|
static ASTs getAttachGrantQueries(const IAccessEntity & user_or_role);
|
|
|
|
bool ignoreQuota() const override { return true; }
|
|
bool ignoreLimits() const override { return true; }
|
|
|
|
private:
|
|
BlockInputStreamPtr executeImpl();
|
|
ASTs getGrantQueries() const;
|
|
std::vector<AccessEntityPtr> getEntities() const;
|
|
|
|
ASTPtr query_ptr;
|
|
};
|
|
|
|
}
|