From e88ef3967bb83e849eab5a33bb2af256cfbc30d1 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Sun, 4 Jan 2026 14:16:16 +0800 Subject: [PATCH] fix the failure message of permission check --- .../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 4daa322d58ec..e8ec61c206e7 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 TSStatus visitAuthor(AuthorStatement statement, TreeAccessCheckContext co } return checkPermissionsWithGrantOption( context, + authorType, Arrays.stream(statement.getPrivilegeList()) .map(s -> PrivilegeType.valueOf(s.toUpperCase())) .collect(Collectors.toList()), @@ -1980,7 +1981,10 @@ protected boolean checkHasGlobalAuth( } protected TSStatus checkPermissionsWithGrantOption( - IAuditEntity auditEntity, List privilegeList, List paths) { + IAuditEntity auditEntity, + AuthorType authorType, + List privilegeList, + List paths) { Supplier supplier = () -> { StringJoiner joiner = new StringJoiner(" "); @@ -2003,7 +2007,7 @@ protected TSStatus checkPermissionsWithGrantOption( 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 @@ protected TSStatus checkPermissionsWithGrantOption( 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; }