Skip to content

Node.js based forum software built for the modern web

fix: have getCidsByPrivilege include cid -1 when set is categories:cid

Julian Lame828e87ec7ee
diff --git a/src/categories/index.js b/src/categories/index.js
index bbdf9f7ece..f2a3b4e7d9 100644
--- a/src/categories/index.js
+++ b/src/categories/index.js
@@ -97,6 +97,10 @@ Categories.getAllCategories = async function () {
Categories.getCidsByPrivilege = async function (set, uid, privilege) {
const cids = await Categories.getAllCidsFromSet(set);
+ if (set === 'categories:cid') {
+ cids.unshift(-1);
+ }
+
return await privileges.categories.filterCids(privilege, cids, uid);
};