diff --git a/src/controllers/write/posts.js b/src/controllers/write/posts.js index f61d33892a..c9c8d21104 100644 --- a/src/controllers/write/posts.js +++ b/src/controllers/write/posts.js @@ -101,9 +101,12 @@ Posts.deleteDiff = async (req, res) => { } const cid = await posts.getCidByPid(req.params.pid); - const isModerator = privileges.users.isModerator(cid, req.uid); + const [isAdmin, isModerator] = await Promise.all([ + privileges.users.isAdministrator(req.uid), + privileges.users.isModerator(req.uid, cid), + ]); - if (!isModerator) { + if (!(isAdmin || isModerator)) { return helpers.formatApiResponse(403, res, new Error('[[error:no-privileges]]')); }