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

sunzesong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 9fc0e17  [IOTDB-827] Fix no permissions for operation LAST (#1587)
9fc0e17 is described below

commit 9fc0e17b2f8f916111cc2ed1ae56f7c282b45eeb
Author: Zesong Sun <[email protected]>
AuthorDate: Fri Jul 31 14:46:49 2020 +0800

    [IOTDB-827] Fix no permissions for operation LAST (#1587)
---
 server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java     | 1 +
 .../test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationIT.java | 2 ++
 2 files changed, 3 insertions(+)

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 ca9676a..3ee55f5 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
@@ -127,6 +127,7 @@ public class AuthorityChecker {
       case INDEXQUERY:
       case MERGEQUERY:
       case AGGREGATION:
+      case LAST:
         return PrivilegeType.READ_TIMESERIES.ordinal();
       case DELETE:
         return PrivilegeType.DELETE_TIMESERIES.ordinal();
diff --git 
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationIT.java
 
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationIT.java
index 92f18d9..c4f0cd2 100644
--- 
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationIT.java
+++ 
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationIT.java
@@ -517,6 +517,8 @@ public class IoTDBAuthorizationIT {
     adminStmt.execute("GRANT USER tempuser PRIVILEGES 'READ_TIMESERIES' on 
root.a");
     userStmt.execute("SELECT * from root.a");
     userStmt.getResultSet().close();
+    userStmt.execute("SELECT LAST b from root.a");
+    userStmt.getResultSet().close();
 
     // revoke privilege to query
     adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'READ_TIMESERIES' on 
root.a");

Reply via email to