1#pragma once
2
3#include <Parsers/IAST.h>
4#include <Access/Quota.h>
5
6
7namespace DB
8{
9/// {role|CURRENT_USER} [,...] | NONE | ALL | ALL EXCEPT {role|CURRENT_USER} [,...]
10class ASTRoleList : public IAST
11{
12public:
13 Strings roles;
14 bool current_user = false;
15 bool all_roles = false;
16 Strings except_roles;
17 bool except_current_user = false;
18
19 bool empty() const { return roles.empty() && !current_user && !all_roles; }
20
21 String getID(char) const override { return "RoleList"; }
22 ASTPtr clone() const override { return std::make_shared<ASTRoleList>(*this); }
23 void formatImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
24};
25}
26