diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-12-14 09:27:46 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-12-14 09:44:12 +0300 |
commit | 76b21190cb48636728f7ab6e26b812dcdecbd004 (patch) | |
tree | 30eb945eef36bd826b737d99baa9cbdb673e03d3 /contrib/clickhouse/src/Interpreters/Access | |
parent | db7f91de8c86629d479db1daf8dddf9704186478 (diff) | |
download | ydb-76b21190cb48636728f7ab6e26b812dcdecbd004.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/clickhouse/src/Interpreters/Access')
-rw-r--r-- | contrib/clickhouse/src/Interpreters/Access/InterpreterGrantQuery.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/clickhouse/src/Interpreters/Access/InterpreterGrantQuery.cpp b/contrib/clickhouse/src/Interpreters/Access/InterpreterGrantQuery.cpp index 1a8268b9b1..518ef1d340 100644 --- a/contrib/clickhouse/src/Interpreters/Access/InterpreterGrantQuery.cpp +++ b/contrib/clickhouse/src/Interpreters/Access/InterpreterGrantQuery.cpp @@ -7,6 +7,7 @@ #include <Access/RolesOrUsersSet.h> #include <Access/User.h> #include <Interpreters/Context.h> +#include <Interpreters/removeOnClusterClauseIfNeeded.h> #include <Interpreters/QueryLog.h> #include <Interpreters/executeDDLQueryOnCluster.h> #include <boost/range/algorithm/copy.hpp> @@ -396,7 +397,8 @@ namespace BlockIO InterpreterGrantQuery::execute() { - auto & query = query_ptr->as<ASTGrantQuery &>(); + const auto updated_query = removeOnClusterClauseIfNeeded(query_ptr, getContext()); + auto & query = updated_query->as<ASTGrantQuery &>(); query.replaceCurrentUserTag(getContext()->getUserName()); query.access_rights_elements.eraseNonGrantable(); @@ -430,7 +432,7 @@ BlockIO InterpreterGrantQuery::execute() current_user_access->checkGranteesAreAllowed(grantees); DDLQueryOnClusterParams params; params.access_to_check = std::move(required_access); - return executeDDLQueryOnCluster(query_ptr, getContext(), params); + return executeDDLQueryOnCluster(updated_query, getContext(), params); } /// Check if the current user has corresponding access rights granted with grant option. |