This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 91310539d9a Add PrivilegeType USE_MODEL
91310539d9a is described below
commit 91310539d9a1e9412967402f2161288df056bd27
Author: YangCaiyin <[email protected]>
AuthorDate: Tue Oct 31 14:52:55 2023 +0800
Add PrivilegeType USE_MODEL
---
.../src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java | 5 +++++
.../antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 | 5 +++++
.../java/org/apache/iotdb/commons/auth/entity/PriPrivilegeType.java | 1 +
.../java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java | 2 ++
.../src/main/java/org/apache/iotdb/commons/auth/entity/Role.java | 4 ++++
5 files changed, 17 insertions(+)
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 37c69ab11aa..4b08c6d9ad4 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
@@ -593,6 +593,7 @@ public class IoTDBAuthIT {
+ ",root.**,USE_UDF,true,\n"
+ ",root.**,USE_CQ,true,\n"
+ ",root.**,USE_PIPE,true,\n"
+ + ",root.**,USE_MODEL,true,\n"
+ ",root.**,EXTEND_TEMPLATE,true,\n"
+ ",root.**,MANAGE_DATABASE,true,\n"
+ ",root.**,MAINTAIN,true,\n"
@@ -942,6 +943,7 @@ public class IoTDBAuthIT {
+ ",root.**,USE_UDF,false,\n"
+ ",root.**,USE_CQ,false,\n"
+ ",root.**,USE_PIPE,false,\n"
+ + ",root.**,USE_MODEL,false,\n"
+ ",root.**,EXTEND_TEMPLATE,false,\n"
+ ",root.**,MANAGE_DATABASE,false,\n"
+ ",root.**,MAINTAIN,false,\n"
@@ -964,6 +966,7 @@ public class IoTDBAuthIT {
+ ",root.**,USE_UDF,true,\n"
+ ",root.**,USE_CQ,true,\n"
+ ",root.**,USE_PIPE,true,\n"
+ + ",root.**,USE_MODEL,true,\n"
+ ",root.**,EXTEND_TEMPLATE,true,\n"
+ ",root.**,MANAGE_DATABASE,true,\n"
+ ",root.**,MAINTAIN,true,\n"
@@ -989,6 +992,7 @@ public class IoTDBAuthIT {
+ ",root.**,USE_UDF,false,\n"
+ ",root.**,USE_CQ,false,\n"
+ ",root.**,USE_PIPE,false,\n"
+ + ",root.**,USE_MODEL,false,\n"
+ ",root.**,EXTEND_TEMPLATE,false,\n"
+ ",root.**,MANAGE_DATABASE,false,\n"
+ ",root.**,MAINTAIN,false,\n"
@@ -1026,6 +1030,7 @@ public class IoTDBAuthIT {
+ ",root.**,USE_UDF,false,\n"
+ ",root.**,USE_CQ,false,\n"
+ ",root.**,USE_PIPE,false,\n"
+ + ",root.**,USE_MODEL,false,\n"
+ ",root.**,EXTEND_TEMPLATE,false,\n"
+ ",root.**,MANAGE_DATABASE,false,\n"
+ ",root.**,MAINTAIN,false,\n"
diff --git
a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
index 6f66d77bc30..406cf689ba4 100644
--- a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
+++ b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
@@ -922,6 +922,7 @@ PRIVILEGE_VALUE
| USE_TRIGGER
| USE_UDF
| USE_CQ
+ | USE_MODEL
| USE_PIPE
| EXTEND_TEMPLATE
| MANAGE_DATABASE
@@ -956,6 +957,10 @@ USE_TRIGGER
: U S E '_' T R I G G E R
;
+USE_MODEL
+ : U S E '_' M O D E L
+ ;
+
USE_UDF
: U S E '_' U D F
;
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PriPrivilegeType.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PriPrivilegeType.java
index d7898624eea..48dc5597d76 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PriPrivilegeType.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PriPrivilegeType.java
@@ -60,6 +60,7 @@ public enum PriPrivilegeType {
PrivilegeType.USE_PIPE,
PrivilegeType.USE_UDF,
PrivilegeType.USE_CQ,
+ PrivilegeType.USE_MODEL,
PrivilegeType.USE_TRIGGER,
PrivilegeType.MANAGE_USER,
PrivilegeType.MANAGE_ROLE,
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
index 73201aeb4ce..3c385679ba3 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
@@ -33,6 +33,8 @@ public enum PrivilegeType {
USE_CQ,
USE_PIPE,
+ USE_MODEL,
+
EXTEND_TEMPLATE,
MANAGE_DATABASE,
MAINTAIN;
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/Role.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/Role.java
index 9533822bcd2..b644ecc369c 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/Role.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/Role.java
@@ -146,6 +146,8 @@ public class Role {
return PrivilegeType.EXTEND_TEMPLATE.ordinal();
case 8:
return PrivilegeType.MAINTAIN.ordinal();
+ case 9:
+ return PrivilegeType.USE_MODEL.ordinal();
default:
return -1;
}
@@ -172,6 +174,8 @@ public class Role {
return 7;
case MAINTAIN:
return 8;
+ case USE_MODEL:
+ return 9;
default:
return -1;
}