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

This commit is contained in:
Julian Lam
2024-04-02 16:47:44 -04:00
parent 893788a2fc
commit e828e87ec7

View File

@@ -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);
};