mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Add auth check before clearing all paragraph
This commit is contained in:
parent
fb7e6ae0c5
commit
2ee452ec0b
2 changed files with 4 additions and 8 deletions
|
|
@ -528,14 +528,11 @@ public class NotebookRestApi {
|
|||
public Response clearAllParagraphOutput(@PathParam("noteId") String noteId)
|
||||
throws IOException {
|
||||
LOG.info("clear all paragraph output of note {}", noteId);
|
||||
checkIfUserCanWrite(noteId, "Insufficient privileges you cannot clear this note");
|
||||
|
||||
if (!noteId.isEmpty()) {
|
||||
Note note = notebook.getNote(noteId);
|
||||
if (note == null) {
|
||||
return new JsonResponse(Status.NOT_FOUND, "note not found.").build();
|
||||
}
|
||||
note.clearAllParagraphOutput();
|
||||
}
|
||||
Note note = notebook.getNote(noteId);
|
||||
checkIfNoteIsNotNull(note);
|
||||
note.clearAllParagraphOutput();
|
||||
|
||||
return new JsonResponse(Status.OK, "").build();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import org.junit.Test;
|
|||
import org.junit.runners.MethodSorters;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue