Skip to content
Snippets Groups Projects
Commit a993d6f9 authored by Michal Kolodziejski's avatar Michal Kolodziejski :bug:
Browse files

Disable note permission check

parent 458d3332
No related tags found
No related merge requests found
Pipeline #1971758 passed
variables:
RELEASE_TAG: 2.2.0
RELEASE_TAG: codimd-archiver-integration
stages:
- run_tests
......
......@@ -79,12 +79,6 @@ async function showNote (req, res) {
}
function canViewNote (note, isLogin, userId) {
if (note.permission === 'private') {
return note.ownerId === userId
}
if (note.permission === 'limited' || note.permission === 'protected') {
return isLogin
}
return true
}
......
......@@ -119,23 +119,11 @@ function newNote (req, res, next) {
}
function newCheckViewPermission (note, isLogin, userId) {
if (note.permission === 'private') {
return note.ownerId === userId
}
if (note.permission === 'limited' || note.permission === 'protected') {
return isLogin
}
return true
}
function checkViewPermission (req, note) {
if (note.permission === 'private') {
if (!req.isAuthenticated() || note.ownerId !== req.user.id) { return false } else { return true }
} else if (note.permission === 'limited' || note.permission === 'protected') {
if (!req.isAuthenticated()) { return false } else { return true }
} else {
return true
}
return true
}
function findNote (req, res, callback, include) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment