jongyoul commented on code in PR #4624:
URL: https://github.com/apache/zeppelin/pull/4624#discussion_r1244498036


##########
zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java:
##########
@@ -1192,24 +1203,38 @@ public void moveFolderToTrash(String folderPath,
                               ServiceContext context,
                               ServiceCallback<Void> callback) throws 
IOException {
 
-    //TODO(zjffdu) folder permission check
     //TODO(zjffdu) folderPath is relative path, need to fix it in frontend
     LOGGER.info("Move folder {} to trash", folderPath);
 
-    String destFolderPath = "/" + NoteManager.TRASH_FOLDER + "/" + folderPath;
-    if (notebook.containsNote(destFolderPath)) {
-      destFolderPath = destFolderPath + " " +
-          TRASH_CONFLICT_TIMESTAMP_FORMATTER.format(Instant.now());
-    }
+    try {
+      NoteManager.Folder folder = notebook.getFolder("/" + folderPath);
+      if (!checkFolderPermission(folder, Permission.OWNER, 
Message.OP.MOVE_FOLDER_TO_TRASH, context, callback)) {
+        return;

Review Comment:
   before returning, shouldn't we call `callback.onFailure`?



-- 
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: dev-unsubscr...@zeppelin.apache.org

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

Reply via email to