mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Fix review comments
This commit is contained in:
parent
3f9e6bb2f0
commit
674767df16
@ -344,7 +344,7 @@ def test_granular_access_create_alter_drop_query(cluster):
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
"DB::Exception: kek: Not enough privileges. to execute this query, it's necessary to have the grant CREATE NAMED COLLECTION"
|
"DB::Exception: kek: Not enough privileges. To execute this query, it's necessary to have the grant CREATE NAMED COLLECTION"
|
||||||
in node.query_and_get_error(
|
in node.query_and_get_error(
|
||||||
"CREATE NAMED COLLECTION collection2 AS key1=1, key2='value2'", user="kek"
|
"CREATE NAMED COLLECTION collection2 AS key1=1, key2='value2'", user="kek"
|
||||||
)
|
)
|
||||||
@ -370,7 +370,7 @@ def test_granular_access_create_alter_drop_query(cluster):
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
"DB::Exception: kek: Not enough privileges. to execute this query, it's necessary to have the grant ALTER NAMED COLLECTION"
|
"DB::Exception: kek: Not enough privileges. To execute this query, it's necessary to have the grant ALTER NAMED COLLECTION"
|
||||||
in node.query_and_get_error(
|
in node.query_and_get_error(
|
||||||
"ALTER NAMED COLLECTION collection2 SET key1=2", user="kek"
|
"ALTER NAMED COLLECTION collection2 SET key1=2", user="kek"
|
||||||
)
|
)
|
||||||
@ -385,14 +385,14 @@ def test_granular_access_create_alter_drop_query(cluster):
|
|||||||
)
|
)
|
||||||
node.query("REVOKE alter named collection ON collection2 FROM kek")
|
node.query("REVOKE alter named collection ON collection2 FROM kek")
|
||||||
assert (
|
assert (
|
||||||
"DB::Exception: kek: Not enough privileges. to execute this query, it's necessary to have the grant ALTER NAMED COLLECTION"
|
"DB::Exception: kek: Not enough privileges. To execute this query, it's necessary to have the grant ALTER NAMED COLLECTION"
|
||||||
in node.query_and_get_error(
|
in node.query_and_get_error(
|
||||||
"ALTER NAMED COLLECTION collection2 SET key1=3", user="kek"
|
"ALTER NAMED COLLECTION collection2 SET key1=3", user="kek"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
"DB::Exception: kek: Not enough privileges. to execute this query, it's necessary to have the grant DROP NAMED COLLECTION"
|
"DB::Exception: kek: Not enough privileges. To execute this query, it's necessary to have the grant DROP NAMED COLLECTION"
|
||||||
in node.query_and_get_error("DROP NAMED COLLECTION collection2", user="kek")
|
in node.query_and_get_error("DROP NAMED COLLECTION collection2", user="kek")
|
||||||
)
|
)
|
||||||
node.query("GRANT drop named collection ON collection2 TO kek")
|
node.query("GRANT drop named collection ON collection2 TO kek")
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
with_on_cluster_02250_ON_CLUSTER_grant_default
|
with_on_cluster_02250_ON_CLUSTER_grant_default
|
||||||
without_on_cluster_02250_ON_CLUSTER_grant_default
|
without_on_cluster_02250_ON_CLUSTER_grant_default
|
||||||
Not enough privileges. to execute this query, it's necessary to have the grant CLUSTER ON *.*. (ACCESS_DENIED)
|
Not enough privileges. To execute this query, it's necessary to have the grant CLUSTER ON *.*. (ACCESS_DENIED)
|
||||||
|
@ -27,5 +27,5 @@ echo "with_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME"
|
|||||||
$CLICKHOUSE_CLIENT --user "with_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME" -q "CREATE DATABASE IF NOT EXISTS db_with_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME ON CLUSTER test_shard_localhost" >/dev/null
|
$CLICKHOUSE_CLIENT --user "with_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME" -q "CREATE DATABASE IF NOT EXISTS db_with_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME ON CLUSTER test_shard_localhost" >/dev/null
|
||||||
echo "without_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME"
|
echo "without_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME"
|
||||||
$CLICKHOUSE_CLIENT --user "without_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME" -q "CREATE DATABASE IF NOT EXISTS db_without_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME ON CLUSTER test_shard_localhost" |& {
|
$CLICKHOUSE_CLIENT --user "without_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME" -q "CREATE DATABASE IF NOT EXISTS db_without_on_cluster_$CLICKHOUSE_TEST_UNIQUE_NAME ON CLUSTER test_shard_localhost" |& {
|
||||||
grep -m1 -F -o "Not enough privileges. to execute this query, it's necessary to have the grant CLUSTER ON *.*. (ACCESS_DENIED)"
|
grep -m1 -F -o "Not enough privileges. To execute this query, it's necessary to have the grant CLUSTER ON *.*. (ACCESS_DENIED)"
|
||||||
}
|
}
|
||||||
|
@ -10,24 +10,24 @@ user=user_$CLICKHOUSE_TEST_UNIQUE_NAME
|
|||||||
$CLICKHOUSE_CLIENT --query "DROP USER IF EXISTS $user"
|
$CLICKHOUSE_CLIENT --query "DROP USER IF EXISTS $user"
|
||||||
$CLICKHOUSE_CLIENT --query "CREATE USER $user IDENTIFIED WITH PLAINTEXT_PASSWORD BY 'hello'"
|
$CLICKHOUSE_CLIENT --query "CREATE USER $user IDENTIFIED WITH PLAINTEXT_PASSWORD BY 'hello'"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_memory_02561(name String)" 2>&1 | grep -F "Not enough privileges. to execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE" > /dev/null && echo "OK"
|
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_memory_02561(name String)" 2>&1 | grep -F "Not enough privileges. To execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE" > /dev/null && echo "OK"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --query "GRANT CREATE TEMPORARY TABLE ON *.* TO $user"
|
$CLICKHOUSE_CLIENT --query "GRANT CREATE TEMPORARY TABLE ON *.* TO $user"
|
||||||
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_memory_02561(name String)"
|
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_memory_02561(name String)"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_merge_tree_02561(name String) ENGINE = MergeTree() ORDER BY name" 2>&1 | grep -F "Not enough privileges. to execute this query, it's necessary to have the grant CREATE ARBITRARY TEMPORARY TABLE" > /dev/null && echo "OK"
|
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_merge_tree_02561(name String) ENGINE = MergeTree() ORDER BY name" 2>&1 | grep -F "Not enough privileges. To execute this query, it's necessary to have the grant CREATE ARBITRARY TEMPORARY TABLE" > /dev/null && echo "OK"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --query "GRANT CREATE ARBITRARY TEMPORARY TABLE ON *.* TO $user"
|
$CLICKHOUSE_CLIENT --query "GRANT CREATE ARBITRARY TEMPORARY TABLE ON *.* TO $user"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_merge_tree_02561(name String) ENGINE = MergeTree() ORDER BY name"
|
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_merge_tree_02561(name String) ENGINE = MergeTree() ORDER BY name"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_file_02561(name String) ENGINE = File(TabSeparated)" 2>&1 | grep -F "Not enough privileges. to execute this query, it's necessary to have the grant FILE" > /dev/null && echo "OK"
|
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_file_02561(name String) ENGINE = File(TabSeparated)" 2>&1 | grep -F "Not enough privileges. To execute this query, it's necessary to have the grant FILE" > /dev/null && echo "OK"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --query "GRANT FILE ON *.* TO $user"
|
$CLICKHOUSE_CLIENT --query "GRANT FILE ON *.* TO $user"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_file_02561(name String) ENGINE = File(TabSeparated)"
|
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_file_02561(name String) ENGINE = File(TabSeparated)"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_url_02561(name String) ENGINE = URL('http://127.0.0.1:8123?query=select+12', 'RawBLOB')" 2>&1 | grep -F "Not enough privileges. to execute this query, it's necessary to have the grant URL" > /dev/null && echo "OK"
|
$CLICKHOUSE_CLIENT --user $user --password hello --query "CREATE TEMPORARY TABLE table_url_02561(name String) ENGINE = URL('http://127.0.0.1:8123?query=select+12', 'RawBLOB')" 2>&1 | grep -F "Not enough privileges. To execute this query, it's necessary to have the grant URL" > /dev/null && echo "OK"
|
||||||
|
|
||||||
$CLICKHOUSE_CLIENT --query "GRANT URL ON *.* TO $user"
|
$CLICKHOUSE_CLIENT --query "GRANT URL ON *.* TO $user"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user