set permissions on note create and import

This commit is contained in:
Khalid Huseynov 2016-11-13 22:15:51 +09:00
parent 44297a40fd
commit 28abffac6a

View file

@ -166,11 +166,7 @@ public class Notebook implements NoteEventListener {
bindInterpretersToNote(subject.getUser(), note.getId(), interpreterIds);
}
if (subject != null && !"anonymous".equals(subject.getUser())) {
Set<String> owners = new HashSet<>();
owners.add(subject.getUser());
notebookAuthorization.setOwners(note.getId(), owners);
}
notebookAuthorization.setNewNotePermissions(note.getId(), subject);
noteSearchService.addIndexDoc(note);
note.persist(subject);
fireNoteCreateEvent(note);
@ -225,6 +221,7 @@ public class Notebook implements NoteEventListener {
newNote.addCloneParagraph(p);
}
notebookAuthorization.setNewNotePermissions(newNote.getId(), subject);
newNote.persist(subject);
} catch (IOException e) {
logger.error(e.toString(), e);