mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: have getCidsByPrivilege include cid -1 when set is categories:cid
This commit is contained in:
@@ -97,6 +97,10 @@ Categories.getAllCategories = async function () {
|
|||||||
|
|
||||||
Categories.getCidsByPrivilege = async function (set, uid, privilege) {
|
Categories.getCidsByPrivilege = async function (set, uid, privilege) {
|
||||||
const cids = await Categories.getAllCidsFromSet(set);
|
const cids = await Categories.getAllCidsFromSet(set);
|
||||||
|
if (set === 'categories:cid') {
|
||||||
|
cids.unshift(-1);
|
||||||
|
}
|
||||||
|
|
||||||
return await privileges.categories.filterCids(privilege, cids, uid);
|
return await privileges.categories.filterCids(privilege, cids, uid);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user