You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/04/29 06:43:15 UTC

[GitHub] [iotdb] wangchao316 commented on a diff in pull request #5699: [IOTDB-3025] add permission check

wangchao316 commented on code in PR #5699:
URL: https://github.com/apache/iotdb/pull/5699#discussion_r861493631


##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java:
##########
@@ -367,4 +367,14 @@ public TSStatus login(String username, String password) {
       return status;
     }
   }
+
+  @Override
+  public TSStatus checkUserPrivileges(String username, List<String> paths, int permission) {
+    TSStatus status = confirmLeader();
+    if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      return AuthorInfo.getInstance().checkUserPrivileges(username, paths, permission);

Review Comment:
   please use PermissionManager.checkUserPrivileges



##########
thrift-confignode/src/main/thrift/confignode.thrift:
##########
@@ -188,4 +194,6 @@ service ConfigIService {
   TAuthorizerResp queryPermission(TAuthorizerReq req)
 
   common.TSStatus login(TLoginReq req)
+
+  common.TSStatus checkUserPrivileges(TCheckUserPrivilegesReq req)

Review Comment:
   add some UT for checkUserPrivileges



##########
confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java:
##########
@@ -77,7 +78,37 @@ public TSStatus login(String username, String password) {
     return tsStatus;
   }
 
-  public TSStatus authorNonQuery(AuthorReq authorReq) throws AuthException {
+  public TSStatus checkUserPrivileges(String username, List<String> paths, int permission) {

Review Comment:
   remove to PermissionManager,  PermissionManager call AuthorInfo



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org