mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-12 22:26:08 -04:00
Fix locked or private permission should block any operation if owner is null
This commit is contained in:
parent
a1198339db
commit
03e68f92eb
2 changed files with 4 additions and 4 deletions
|
@ -540,7 +540,7 @@ function ifMayEdit(socket, callback) {
|
|||
break;
|
||||
case "locked": case "private":
|
||||
//only owner can change
|
||||
if (note.owner != socket.request.user.id)
|
||||
if (!note.owner || note.owner != socket.request.user.id)
|
||||
mayEdit = false;
|
||||
break;
|
||||
}
|
||||
|
@ -641,7 +641,7 @@ function connection(socket) {
|
|||
if (!noteId || !notes[noteId]) return;
|
||||
var note = notes[noteId];
|
||||
//Only owner can change permission
|
||||
if (note.owner == socket.request.user.id) {
|
||||
if (note.owner && note.owner == socket.request.user.id) {
|
||||
note.permission = permission;
|
||||
models.Note.update({
|
||||
permission: permission
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue