Skip to content

Commit ffc4e86

Browse files
committed
fix conversation
1 parent 2fe5773 commit ffc4e86

File tree

4 files changed

+14
-40
lines changed

4 files changed

+14
-40
lines changed

src/meta/proto-conv/tests/it/v136_add_grant_object_connection.rs

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,15 @@ use crate::common;
3636
//
3737

3838
#[test]
39-
fn test_decode_v136_grant_object() -> anyhow::Result<()> {
39+
fn test_decode_v136_grant_connection_object() -> anyhow::Result<()> {
4040
let role_info_v136 = vec![
41-
10, 2, 114, 49, 18, 214, 1, 10, 23, 10, 9, 10, 0, 160, 6, 136, 1, 168, 6, 24, 16, 128, 128,
41+
10, 2, 114, 49, 18, 86, 10, 23, 10, 9, 10, 0, 160, 6, 136, 1, 168, 6, 24, 16, 128, 128,
4242
128, 2, 160, 6, 136, 1, 168, 6, 24, 10, 27, 10, 13, 74, 4, 10, 2, 99, 49, 160, 6, 136, 1,
43-
168, 6, 24, 16, 128, 128, 128, 4, 160, 6, 136, 1, 168, 6, 24, 10, 33, 10, 22, 18, 13, 10,
44-
7, 100, 101, 102, 97, 117, 108, 116, 18, 2, 100, 98, 160, 6, 136, 1, 168, 6, 24, 16, 2,
45-
160, 6, 136, 1, 168, 6, 24, 10, 37, 10, 26, 26, 17, 10, 7, 100, 101, 102, 97, 117, 108,
46-
116, 18, 2, 100, 98, 26, 2, 116, 98, 160, 6, 136, 1, 168, 6, 24, 16, 2, 160, 6, 136, 1,
47-
168, 6, 24, 10, 24, 10, 13, 34, 4, 10, 2, 102, 49, 160, 6, 136, 1, 168, 6, 24, 16, 1, 160,
48-
6, 136, 1, 168, 6, 24, 10, 26, 10, 13, 42, 4, 10, 2, 115, 49, 160, 6, 136, 1, 168, 6, 24,
49-
16, 128, 128, 32, 160, 6, 136, 1, 168, 6, 24, 10, 23, 10, 9, 10, 0, 160, 6, 136, 1, 168, 6,
50-
24, 16, 254, 255, 191, 7, 160, 6, 136, 1, 168, 6, 24, 160, 6, 136, 1, 168, 6, 24, 26, 23,
51-
49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 48, 48, 32, 85, 84, 67,
52-
34, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 48, 48, 32, 85,
53-
84, 67, 160, 6, 136, 1, 168, 6, 24,
43+
168, 6, 24, 16, 128, 128, 128, 4, 160, 6, 136, 1, 168, 6, 24, 10, 23, 10, 9, 10, 0, 160, 6,
44+
136, 1, 168, 6, 24, 16, 254, 255, 191, 7, 160, 6, 136, 1, 168, 6, 24, 160, 6, 136, 1, 168,
45+
6, 24, 26, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 48, 48,
46+
32, 85, 84, 67, 34, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58,
47+
48, 48, 32, 85, 84, 67, 160, 6, 136, 1, 168, 6, 24,
5448
];
5549
let want = || mt::principal::RoleInfo {
5650
name: "r1".to_string(),
@@ -64,26 +58,6 @@ fn test_decode_v136_grant_object() -> anyhow::Result<()> {
6458
mt::principal::GrantObject::Connection("c1".to_string()),
6559
make_bitflags!(UserPrivilegeType::{AccessConnection}),
6660
),
67-
mt::principal::GrantEntry::new(
68-
mt::principal::GrantObject::Database("default".to_string(), "db".to_string()),
69-
make_bitflags!(UserPrivilegeType::{Create}),
70-
),
71-
mt::principal::GrantEntry::new(
72-
mt::principal::GrantObject::Table(
73-
"default".to_string(),
74-
"db".to_string(),
75-
"tb".to_string(),
76-
),
77-
make_bitflags!(UserPrivilegeType::{Create}),
78-
),
79-
mt::principal::GrantEntry::new(
80-
mt::principal::GrantObject::UDF("f1".to_string()),
81-
make_bitflags!(UserPrivilegeType::{Usage}),
82-
),
83-
mt::principal::GrantEntry::new(
84-
mt::principal::GrantObject::Stage("s1".to_string()),
85-
make_bitflags!(UserPrivilegeType::{Write}),
86-
),
8761
// test new global privilege CreateConneciton, AccessConnection
8862
mt::principal::GrantEntry::new(
8963
mt::principal::GrantObject::Global,
@@ -103,7 +77,7 @@ fn test_decode_v136_grant_object() -> anyhow::Result<()> {
10377
}
10478

10579
#[test]
106-
fn test_decode_v136_ownership() -> anyhow::Result<()> {
80+
fn test_decode_v136_connection_ownership() -> anyhow::Result<()> {
10781
let ownership_info_v136 = vec![
10882
10, 2, 114, 49, 18, 13, 50, 4, 10, 2, 99, 49, 160, 6, 136, 1, 168, 6, 24, 160, 6, 136, 1,
10983
168, 6, 24,

src/meta/protos/proto/ownership.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ message OwnershipObject {
5050
string id = 1;
5151
}
5252

53-
message OwnershipConnectionObject {
54-
string connection = 1;
55-
}
53+
message OwnershipConnectionObject {
54+
string connection = 1;
55+
}
5656

5757
oneof object {
5858
OwnershipDatabaseObject database = 1;

src/meta/protos/proto/user.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ message GrantObject {
8282
}
8383

8484
message GrantConnectionObject {
85-
string connection = 1;
86-
}
85+
string connection = 1;
86+
}
8787

8888
oneof object {
8989
GrantGlobalObject global = 1;

src/query/service/src/interpreters/access/privilege_access.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl PrivilegeAccess {
265265

266266
return Err(ErrorCode::PermissionDenied(format!(
267267
"Permission denied: privilege [{:?}] is required on '{}'.'{}'.* for user {} with roles [{}]. \
268-
Note: Please ensure that your current role have the appropriate permissions to create a new Warehouse|Database|Table|UDF|Stage.",
268+
Note: Please ensure that your current role have the appropriate permissions to create a new Warehouse|Database|Table|UDF|Stage|Connection",
269269
privileges,
270270
catalog_name,
271271
db_name,

0 commit comments

Comments
 (0)