-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(query): revoke need consider GrantObject::Database/Table (#14567)
* fix(query): revoke need consider GrantObject::Database/Table * add some comment about revoke old version, all contains ownership privilege. now will not revoke ownership privilege. so the user will contains the object's ownership Then in bind_revoke, if revoke all on <object> from user, need contains ownership.
- Loading branch information
Showing
6 changed files
with
115 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/fuse-compat/compat-logictest/revoke/fuse_compat_read
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
query T | ||
show grants for a; | ||
---- | ||
GRANT INSERT ON 'default'.'default'.'t' TO 'a'@'%' | ||
GRANT SELECT ON 'default'.'default'.* TO 'a'@'%' | ||
GRANT ALL ON 'default'.'db'.* TO 'a'@'%' | ||
|
||
statement ok | ||
revoke insert on default.t from a; | ||
|
||
statement ok | ||
revoke select on default.* from a; | ||
|
||
statement ok | ||
revoke all on db.* from a; | ||
|
||
query T | ||
show grants for a; | ||
---- | ||
|
20 changes: 20 additions & 0 deletions
20
tests/fuse-compat/compat-logictest/revoke/fuse_compat_write
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
statement ok | ||
drop user if exists a; | ||
|
||
statement ok | ||
create table t(id int); | ||
|
||
statement ok | ||
create user a identified by '123'; | ||
|
||
statement ok | ||
grant insert on default.t to a; | ||
|
||
statement ok | ||
grant select on default.* to a; | ||
|
||
statement ok | ||
create database if not exists db; | ||
|
||
statement ok | ||
grant all on db.* to a; |