You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by sp...@apache.org on 2023/07/13 11:50:39 UTC
[iotdb] 01/01: add MAINTAIN
This is an automated email from the ASF dual-hosted git repository.
spricoder pushed a commit to branch refactor/add_maintain_auth
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit f7d6845132b7a80381e8ca40033b6fed0837826f
Author: spricoder <sp...@qq.com>
AuthorDate: Thu Jul 13 19:50:26 2023 +0800
add MAINTAIN
---
.../antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 | 5 +++++
.../java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
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 d1cac40b30d..26e62b1ec49 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
@@ -917,6 +917,7 @@ PRIVILEGE_VALUE
| USE_CQ
| USE_PIPE
| MANAGE_DATABASE
+ | MAINTAIN
;
READ_DATA
@@ -967,6 +968,10 @@ MANAGE_DATABASE
: M A N A G E '_' D A T A B A S E
;
+MAINTAIN
+ : M A I N T A I N
+ ;
+
SCHEMA_REPLICATION_FACTOR
: S C H E M A '_' R E P L I C A T I O N '_' F A C T O R
;
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 8f5f7bbd131..9c1203fd11d 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
@@ -40,6 +40,7 @@ public enum PrivilegeType {
USE_CQ,
USE_PIPE,
MANAGE_DATABASE(true),
+ MAINTAIN,
READ(true, false, READ_DATA, READ_SCHEMA),
WRITE(true, false, WRITE_DATA, WRITE_SCHEMA),
ALL(
@@ -54,7 +55,8 @@ public enum PrivilegeType {
USE_TRIGGER,
USE_CQ,
USE_PIPE,
- MANAGE_DATABASE);
+ MANAGE_DATABASE,
+ MAINTAIN);
private static final int PRIVILEGE_COUNT = values().length;