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

shuwenwei pushed a commit to branch fixCheckPermissionFailureMessage
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit e88ef3967bb83e849eab5a33bb2af256cfbc30d1
Author: shuwenwei <[email protected]>
AuthorDate: Sun Jan 4 14:16:16 2026 +0800

    fix the failure message of permission check
---
 .../plan/relational/security/TreeAccessCheckVisitor.java       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
index 4daa322d58e..e8ec61c206e 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
@@ -671,6 +671,7 @@ public class TreeAccessCheckVisitor extends 
StatementVisitor<TSStatus, TreeAcces
         }
         return checkPermissionsWithGrantOption(
             context,
+            authorType,
             Arrays.stream(statement.getPrivilegeList())
                 .map(s -> PrivilegeType.valueOf(s.toUpperCase()))
                 .collect(Collectors.toList()),
@@ -1980,7 +1981,10 @@ public class TreeAccessCheckVisitor extends 
StatementVisitor<TSStatus, TreeAcces
   }
 
   protected TSStatus checkPermissionsWithGrantOption(
-      IAuditEntity auditEntity, List<PrivilegeType> privilegeList, 
List<PartialPath> paths) {
+      IAuditEntity auditEntity,
+      AuthorType authorType,
+      List<PrivilegeType> privilegeList,
+      List<PartialPath> paths) {
     Supplier<String> supplier =
         () -> {
           StringJoiner joiner = new StringJoiner(" ");
@@ -2003,7 +2007,7 @@ public class TreeAccessCheckVisitor extends 
StatementVisitor<TSStatus, TreeAcces
               AuthorityChecker.getTSStatus(
                   false,
                   "Has no permission to execute "
-                      + privilegeType
+                      + authorType
                       + ", please ensure you have these privileges and the 
grant option is TRUE when granted");
           break;
         }
@@ -2014,7 +2018,7 @@ public class TreeAccessCheckVisitor extends 
StatementVisitor<TSStatus, TreeAcces
               AuthorityChecker.getTSStatus(
                   false,
                   "Has no permission to execute "
-                      + privilegeType
+                      + authorType
                       + ", please ensure you have these privileges and the 
grant option is TRUE when granted");
           break;
         }

Reply via email to