This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new e0261ffb9c7 [fix](auth)Fix all priv not contain Show_view_priv 
(#43605) (#44289)
e0261ffb9c7 is described below

commit e0261ffb9c7e0923a52653b40e6afb0bb711885f
Author: zhangdong <zhangd...@selectdb.com>
AuthorDate: Wed Nov 20 10:33:49 2024 +0800

    [fix](auth)Fix all priv not contain Show_view_priv (#43605) (#44289)
    
    pick: https://github.com/apache/doris/pull/43605
---
 .../org/apache/doris/catalog/AccessPrivilege.java  |  2 +-
 .../suites/auth_p0/test_grant_all_auth.groovy      | 36 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/AccessPrivilege.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/AccessPrivilege.java
index becbdfd7fe1..dba702de95d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/AccessPrivilege.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/AccessPrivilege.java
@@ -59,7 +59,7 @@ public enum AccessPrivilege {
             case 3:
                 return Lists.newArrayList(Privilege.SELECT_PRIV, 
Privilege.LOAD_PRIV,
                         Privilege.ALTER_PRIV, Privilege.CREATE_PRIV,
-                        Privilege.DROP_PRIV);
+                        Privilege.DROP_PRIV, Privilege.SHOW_VIEW_PRIV);
             case 4:
                 return Lists.newArrayList(Privilege.NODE_PRIV);
             case 5:
diff --git a/regression-test/suites/auth_p0/test_grant_all_auth.groovy 
b/regression-test/suites/auth_p0/test_grant_all_auth.groovy
new file mode 100644
index 00000000000..6f565484ed8
--- /dev/null
+++ b/regression-test/suites/auth_p0/test_grant_all_auth.groovy
@@ -0,0 +1,36 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import org.junit.Assert;
+
+suite("test_grant_all_auth","p0,auth") {
+    String suiteName = "test_grant_all_auth"
+    String user = "${suiteName}_user"
+    String pwd = 'C123_567p'
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """grant all on *.*.* to ${user}"""
+    def res = sql """ show grants for ${user} """
+    logger.info("res: " + res.toString())
+    assertTrue(res.toString().contains("Select_priv"))
+    assertTrue(res.toString().contains("Load_priv"))
+    assertTrue(res.toString().contains("Alter_priv"))
+    assertTrue(res.toString().contains("Create_priv"))
+    assertTrue(res.toString().contains("Drop_priv"))
+    assertTrue(res.toString().contains("Show_view_priv"))
+    try_sql("DROP USER ${user}")
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to