mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #11362, regular mods are also subject to post queue [breaking]
This commit is contained in:
@@ -210,9 +210,15 @@ modsController.postQueue = async function (req, res, next) {
|
||||
helpers.getSelectedCategory(cid),
|
||||
]);
|
||||
|
||||
postData = postData.filter(p => p &&
|
||||
(!categoriesData.selectedCids.length || categoriesData.selectedCids.includes(p.category.cid)) &&
|
||||
(isAdmin || isGlobalMod || moderatedCids.includes(Number(p.category.cid)) || req.uid === p.user.uid));
|
||||
postData = postData
|
||||
.filter(p => p &&
|
||||
(!categoriesData.selectedCids.length || categoriesData.selectedCids.includes(p.category.cid)) &&
|
||||
(isAdmin || isGlobalMod || moderatedCids.includes(Number(p.category.cid)) || req.uid === p.user.uid))
|
||||
.map((post) => {
|
||||
const isSelf = post.user.uid === req.uid;
|
||||
post.canAccept = !isSelf && (isAdmin || isGlobalMod || !!moderatedCids.length);
|
||||
return post;
|
||||
});
|
||||
|
||||
({ posts: postData } = await plugins.hooks.fire('filter:post-queue.get', {
|
||||
posts: postData,
|
||||
@@ -232,7 +238,7 @@ modsController.postQueue = async function (req, res, next) {
|
||||
title: '[[pages:post-queue]]',
|
||||
posts: postData,
|
||||
isAdmin: isAdmin,
|
||||
canAccept: isAdmin || isGlobalMod || !!moderatedCids.length,
|
||||
canAccept: isAdmin || isGlobalMod,
|
||||
...categoriesData,
|
||||
allCategoriesUrl: `post-queue${helpers.buildQueryString(req.query, 'cid', '')}`,
|
||||
pagination: pagination.create(page, pageCount),
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
</div>
|
||||
<div class="card-footer text-end">
|
||||
<div>
|
||||
{{{ if canAccept }}}
|
||||
{{{ if ./canAccept }}}
|
||||
<button class="btn btn-danger btn-sm" data-action="reject"><i class="fa fa-fw fa-times"></i> [[post-queue:reject]]</button>
|
||||
<button class="btn btn-info btn-sm" data-action="notify"><i class="fa fa-fw fa-bell-o"></i> [[post-queue:notify]]</button>
|
||||
<button class="btn btn-success btn-sm" data-action="accept"><i class="fa fa-fw fa-check"></i> [[post-queue:accept]] </button>
|
||||
|
||||
Reference in New Issue
Block a user