2020-06-10 23:08:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/IInterpreter.h>
|
|
|
|
#include <Parsers/IAST_fwd.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-04-10 23:33:54 +00:00
|
|
|
|
2020-06-10 23:08:37 +00:00
|
|
|
struct IAccessEntity;
|
|
|
|
using AccessEntityPtr = std::shared_ptr<const IAccessEntity>;
|
|
|
|
|
|
|
|
/** Return all queries for creating access entities and grants.
|
|
|
|
*/
|
2021-04-10 23:33:54 +00:00
|
|
|
class InterpreterShowAccessQuery : public IInterpreter, WithContext
|
2020-06-10 23:08:37 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-10 23:33:54 +00:00
|
|
|
InterpreterShowAccessQuery(const ASTPtr & query_ptr_, ContextPtr context_) : WithContext(context_), query_ptr(query_ptr_) {}
|
2020-06-10 23:08:37 +00:00
|
|
|
|
|
|
|
BlockIO execute() override;
|
|
|
|
|
|
|
|
bool ignoreQuota() const override { return true; }
|
|
|
|
bool ignoreLimits() const override { return true; }
|
|
|
|
|
|
|
|
private:
|
2021-09-15 19:35:48 +00:00
|
|
|
QueryPipeline executeImpl() const;
|
2020-06-10 23:08:37 +00:00
|
|
|
ASTs getCreateAndGrantQueries() const;
|
|
|
|
std::vector<AccessEntityPtr> getEntities() const;
|
|
|
|
|
|
|
|
ASTPtr query_ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|