summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xlib/response.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/response.js b/lib/response.js
index 69854815..e8430d60 100755
--- a/lib/response.js
+++ b/lib/response.js
@@ -117,12 +117,15 @@ function newNote(req, res, next) {
}
function checkViewPermission(req, note) {
- if (note.permission == 'private' || !config.allowanonymousView) {
+ if (note.permission == 'private') {
if (!req.isAuthenticated() || note.ownerId != req.user.id)
return false;
else
return true;
} else {
+ if(!config.allowanonymousView && !req.isAuthenticated()) {
+ return false;
+ }
return true;
}
}