mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Merge cf86df9966
into 44b4bd38b9
This commit is contained in:
commit
334c91bbef
@ -168,6 +168,12 @@ AccessRights ContextAccess::addImplicitAccessRights(const AccessRights & access,
|
|||||||
res |= show_databases;
|
res |= show_databases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const AccessFlags alter_delete = AccessType::ALTER_DELETE;
|
||||||
|
static const AccessFlags select = AccessType::SELECT;
|
||||||
|
static const AccessFlags move_partition = AccessType::ALTER_MOVE_PARTITION;
|
||||||
|
if ((res & alter_delete) && (res & select) && level <= 2)
|
||||||
|
res |= move_partition;
|
||||||
|
|
||||||
max_flags |= res;
|
max_flags |= res;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -467,11 +467,11 @@ AccessRightsElements InterpreterAlterQuery::getRequiredAccessForCommand(const AS
|
|||||||
required_access.emplace_back(AccessType::ALTER_MOVE_PARTITION, database, table);
|
required_access.emplace_back(AccessType::ALTER_MOVE_PARTITION, database, table);
|
||||||
break;
|
break;
|
||||||
case DataDestinationType::TABLE:
|
case DataDestinationType::TABLE:
|
||||||
required_access.emplace_back(AccessType::SELECT | AccessType::ALTER_DELETE, database, table);
|
required_access.emplace_back(AccessType::ALTER_MOVE_PARTITION, database, table);
|
||||||
required_access.emplace_back(AccessType::INSERT, command.to_database, command.to_table);
|
required_access.emplace_back(AccessType::INSERT, command.to_database, command.to_table);
|
||||||
break;
|
break;
|
||||||
case DataDestinationType::SHARD:
|
case DataDestinationType::SHARD:
|
||||||
required_access.emplace_back(AccessType::SELECT | AccessType::ALTER_DELETE, database, table);
|
required_access.emplace_back(AccessType::ALTER_MOVE_PARTITION, database, table);
|
||||||
required_access.emplace_back(AccessType::MOVE_PARTITION_BETWEEN_SHARDS);
|
required_access.emplace_back(AccessType::MOVE_PARTITION_BETWEEN_SHARDS);
|
||||||
break;
|
break;
|
||||||
case DataDestinationType::DELETE:
|
case DataDestinationType::DELETE:
|
||||||
|
Loading…
Reference in New Issue
Block a user