-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: grant default CONNECT action for new created user (#7716)
To fix #7596 , since we don't have concept of PUBLIC group yet, for newly create user, this PR will simply grant CONNECT action of the current database in session. Note that, like PostgreSQL we still need to grant other actions for new user, so that he can do more operation rather than just connect. ```sql ~ psql -h localhost -p 4566 -d dev -U root psql (14.5 (Homebrew), server 9.5.0) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help. dev=> create table a (v1 integer); CREATE_TABLE dev=> create user xxx with password 'abc'; CREATE_USER dev=> \q ~ psql -h localhost -p 4566 -d dev -U xxx Password for user xxx: psql (14.5 (Homebrew), server 9.5.0) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help. dev=> select * from a; ERROR: QueryError: Permission denied: Do not have the privilege dev=> \q ~ psql -h localhost -p 4566 -d dev -U root psql (14.5 (Homebrew), server 9.5.0) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help. dev=> create materialized view mv1 as select * from a; CREATE_MATERIALIZED_VIEW dev=> grant all on materialized view mv1 to xxx; GRANT_PRIVILEGE dev=> insert into a values (1),(2),(3); INSERT 0 3 dev=> \q ~ psql -h localhost -p 4566 -d dev -U xxx Password for user xxx: psql (14.5 (Homebrew), server 9.5.0) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help. dev=> select * from mv1; v1 ---- 3 2 1 (3 rows) ``` Approved-By: chenzl25 Approved-By: xxchan
- Loading branch information
1 parent
4f54a70
commit 1193d53
Showing
4 changed files
with
68 additions
and
27 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