This is an automated email from the ASF dual-hosted git repository.

spricoder pushed a commit to branch refactor/new_auth
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit e5bc30d750722938bece32e38af20dbb0ec61956
Author: spricoder <[email protected]>
AuthorDate: Sat Jun 24 22:23:34 2023 +0800

    Merge CREATE_FUNCTION and DROP_FUNCTION
---
 .../java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java     | 5 +++--
 server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java  | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
 
b/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
index c03c9d03fbe..4eee79a52f3 100644
--- 
a/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
+++ 
b/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java
@@ -21,7 +21,10 @@ package org.apache.iotdb.commons.auth.entity;
 
 /** This enum class contains all available privileges in IoTDB. */
 public enum PrivilegeType {
+  // create or delete database
   CREATE_DATABASE(true),
+  // create or drop function TODO select data and show function
+  READ_DATA(true),
   INSERT_TIMESERIES(true),
   @Deprecated
   UPDATE_TIMESERIES(true),
@@ -41,8 +44,6 @@ public enum PrivilegeType {
   LIST_ROLE,
   GRANT_ROLE_PRIVILEGE,
   REVOKE_ROLE_PRIVILEGE,
-  CREATE_FUNCTION,
-  DROP_FUNCTION,
   CREATE_TRIGGER(true),
   DROP_TRIGGER(true),
   START_TRIGGER(true),
diff --git 
a/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java 
b/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java
index 6a230af6b1a..7e8cb9a1309 100644
--- a/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java
+++ b/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java
@@ -212,9 +212,8 @@ public class AuthorityChecker {
       case LIST_USER_PRIVILEGE:
         return PrivilegeType.LIST_USER.ordinal();
       case CREATE_FUNCTION:
-        return PrivilegeType.CREATE_FUNCTION.ordinal();
       case DROP_FUNCTION:
-        return PrivilegeType.DROP_FUNCTION.ordinal();
+        return PrivilegeType.READ_DATA.ordinal();
       case CREATE_TRIGGER:
         return PrivilegeType.CREATE_TRIGGER.ordinal();
       case DROP_TRIGGER:

Reply via email to