Skip to content

Commit

Permalink
fix: dont let mods load postqueue for a cid they are not a mod of
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Oct 5, 2020
1 parent 2ea9768 commit 7bf6d3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controllers/mods.js
Expand Up @@ -213,7 +213,9 @@ modsController.postQueue = async function (req, res, next) {
categories.buildForSelect(req.uid, 'find', ['disabled', 'link', 'slug']),
helpers.getCategoriesByStates(req.uid, cid, null, 'moderate'),
]);

if (!moderatedCids.includes(String(cid)) && !isAdminOrGlobalMod) {
return next();
}
allCategories.forEach((c) => {
c.disabledClass = !isAdminOrGlobalMod && !moderatedCids.includes(String(c.cid));
});
Expand Down

0 comments on commit 7bf6d3b

Please sign in to comment.