Skip to content

Commit e88ef39

Browse files
committed
fix the failure message of permission check
1 parent c531044 commit e88ef39

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ public TSStatus visitAuthor(AuthorStatement statement, TreeAccessCheckContext co
671671
}
672672
return checkPermissionsWithGrantOption(
673673
context,
674+
authorType,
674675
Arrays.stream(statement.getPrivilegeList())
675676
.map(s -> PrivilegeType.valueOf(s.toUpperCase()))
676677
.collect(Collectors.toList()),
@@ -1980,7 +1981,10 @@ protected boolean checkHasGlobalAuth(
19801981
}
19811982

19821983
protected TSStatus checkPermissionsWithGrantOption(
1983-
IAuditEntity auditEntity, List<PrivilegeType> privilegeList, List<PartialPath> paths) {
1984+
IAuditEntity auditEntity,
1985+
AuthorType authorType,
1986+
List<PrivilegeType> privilegeList,
1987+
List<PartialPath> paths) {
19841988
Supplier<String> supplier =
19851989
() -> {
19861990
StringJoiner joiner = new StringJoiner(" ");
@@ -2003,7 +2007,7 @@ protected TSStatus checkPermissionsWithGrantOption(
20032007
AuthorityChecker.getTSStatus(
20042008
false,
20052009
"Has no permission to execute "
2006-
+ privilegeType
2010+
+ authorType
20072011
+ ", please ensure you have these privileges and the grant option is TRUE when granted");
20082012
break;
20092013
}
@@ -2014,7 +2018,7 @@ protected TSStatus checkPermissionsWithGrantOption(
20142018
AuthorityChecker.getTSStatus(
20152019
false,
20162020
"Has no permission to execute "
2017-
+ privilegeType
2021+
+ authorType
20182022
+ ", please ensure you have these privileges and the grant option is TRUE when granted");
20192023
break;
20202024
}

0 commit comments

Comments
 (0)