ClickHouse/src/Interpreters/Access/InterpreterShowCreateAccessEntityQuery.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
C++
Raw Normal View History

2019-12-01 22:01:05 +00:00
#pragma once
#include <Interpreters/IInterpreter.h>
#include <Parsers/IAST_fwd.h>
#include <Core/UUID.h>
2019-12-01 22:01:05 +00:00
namespace DB
{
class AccessControl;
2019-12-01 22:01:05 +00:00
class Context;
class AccessRightsElements;
struct IAccessEntity;
using AccessEntityPtr = std::shared_ptr<const IAccessEntity>;
2019-12-01 22:01:05 +00:00
/** Returns a single item containing a statement which could be used to create a specified role.
*/
class InterpreterShowCreateAccessEntityQuery : public IInterpreter, WithContext
2019-12-01 22:01:05 +00:00
{
public:
InterpreterShowCreateAccessEntityQuery(const ASTPtr & query_ptr_, ContextPtr context_);
2019-12-01 22:01:05 +00:00
BlockIO execute() override;
2020-06-10 23:08:37 +00:00
bool ignoreQuota() const override { return true; }
bool ignoreLimits() const override { return true; }
2019-12-01 22:01:05 +00:00
2022-03-21 05:41:33 +00:00
static ASTPtr getCreateQuery(const IAccessEntity & entity, const AccessControl & access_control);
static ASTPtr getAttachQuery(const IAccessEntity & entity);
2019-12-01 22:01:05 +00:00
private:
2021-09-15 19:35:48 +00:00
QueryPipeline executeImpl();
std::vector<AccessEntityPtr> getEntities() const;
ASTs getCreateQueries() const;
AccessRightsElements getRequiredAccess() const;
ASTPtr query_ptr;
2019-12-01 22:01:05 +00:00
};
}