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:
|
|
|
|
BlockInputStreamPtr executeImpl() const;
|
|
|
|
ASTs getCreateAndGrantQueries() const;
|
|
|
|
std::vector<AccessEntityPtr> getEntities() const;
|
|
|
|
|
|
|
|
ASTPtr query_ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|