Add support of allow anonymous config option with correspond modifications

This commit is contained in:
Wu Cheng-Han 2016-12-15 14:07:12 +08:00
parent cf8bae32d1
commit 5c7eb48319
6 changed files with 15 additions and 1 deletions

View file

@ -763,6 +763,7 @@ function connection(socket) {
var note = notes[noteId];
//Only owner can change permission
if (note.owner && note.owner == socket.request.user.id) {
if (permission == 'freely' && !config.allowanonmyous) return;
note.permission = permission;
models.Note.update({
permission: permission