diff --git a/api/policies/isPostMod.js b/api/policies/isPostMod.js new file mode 100644 index 00000000..4058247e --- /dev/null +++ b/api/policies/isPostMod.js @@ -0,0 +1 @@ +module.exports = (req, res, next) => (Users.hasModPermission(req.user, 'posts') && Users.hasModPermission(req.user, 'wiki')) ? next() : res.forbidden("Not post mod"); diff --git a/api/services/Users.js b/api/services/Users.js index 552122fe..ed8416e8 100644 --- a/api/services/Users.js +++ b/api/services/Users.js @@ -28,7 +28,7 @@ exports.get = async function (requester, username) { user.comments = result; })); - if (Users.hasModPermission(requester, 'access')) { + if (Users.hasModPermission(requester, 'posts') && Users.hasModPermission(requester, 'wiki')) { promises.push(ModNote.find({refUser: user.name}).sort({createdAt: 'desc'}).then(function (result) { user.modNotes = result; })); diff --git a/assets/views/home/modEdit.ejs b/assets/views/home/modEdit.ejs index d673ee91..3214be8d 100644 --- a/assets/views/home/modEdit.ejs +++ b/assets/views/home/modEdit.ejs @@ -17,7 +17,7 @@ {{note.user}} {{note.createdAt | date: "medium"}} - + @@ -27,7 +27,7 @@ -