This is an automated email from the ASF dual-hosted git repository. shuwenwei pushed a commit to branch AuthEnhance in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/AuthEnhance by this push: new 6eddc5d7674 fix it 6eddc5d7674 is described below commit 6eddc5d76745bf9ca011164fa7a2ca82fed3b0f7 Author: shuwenwei <s13979062...@gmail.com> AuthorDate: Thu Sep 18 17:52:41 2025 +0800 fix it --- .../src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java | 8 +------- .../java/org/apache/iotdb/commons/auth/user/BasicUserManager.java | 3 +++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java index 2e3534006ff..0945d3164ce 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java @@ -1015,7 +1015,6 @@ public class IoTDBAuthIT { ans = ",,SYSTEM,true,\n" + ",,SECURITY,true,\n" - + ",,AUDIT,true,\n" + ",root.**,READ_DATA,true,\n" + ",root.**,WRITE_DATA,true,\n" + ",root.**,READ_SCHEMA,true,\n" @@ -1034,16 +1033,11 @@ public class IoTDBAuthIT { ans = ",,SYSTEM,false,\n" + ",,SECURITY,false,\n" - + ",,AUDIT,false,\n" + ",root.**,READ_DATA,false,\n" + ",root.**,WRITE_DATA,false,\n" + ",root.**,READ_SCHEMA,false,\n" + ",root.**,WRITE_SCHEMA,false,\n"; validateResultSet(resultSet, ans); - Assert.assertThrows( - SQLException.class, () -> userStmt.execute("GRANT SECURITY ON root.** TO USER user3")); - Assert.assertThrows( - SQLException.class, () -> userStmt.execute("REVOKE SYSTEM ON root.** FROM USER user2")); } finally { userStmt.close(); } @@ -1118,7 +1112,7 @@ public class IoTDBAuthIT { if (item == PrivilegeType.AUDIT) { continue; } - if (item.isRelationalPrivilege() || item.isAdminPrivilege()) { + if (item.isRelationalPrivilege()) { continue; } String sql = "GRANT %s on root.** to USER user1 WITH GRANT OPTION"; diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java index 296cd0fa6a4..86e4f46d235 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java @@ -82,6 +82,9 @@ public abstract class BasicUserManager extends BasicRoleManager { PartialPath rootPath = new PartialPath(IoTDBConstant.PATH_ROOT + ".**"); PathPrivilege pathPri = new PathPrivilege(rootPath); for (PrivilegeType item : PrivilegeType.values()) { + if (item.isDeprecated()) { + continue; + } if (item.isSystemPrivilege()) { admin.grantSysPrivilege(item, true); } else if (item.isRelationalPrivilege()) {