Merge branch 'webpack5' of https://github.com/NodeBB/NodeBB into webpack5

This commit is contained in:
Barış Soner Uşaklı
2022-03-10 18:58:41 -05:00
2 changed files with 3 additions and 2 deletions

View File

@@ -120,7 +120,7 @@ privsAdmin.list = async function (uid) {
// Restrict privileges column to superadmins
if (!(await user.isAdministrator(uid))) {
const idx = privsAdmin.userPrivilegeList.indexOf('admin:privileges');
const idx = Array.from(_privilegeMap.keys()).indexOf('admin:privileges');
privilegeLabels.splice(idx, 1);
userPrivilegeList.splice(idx, 1);
groupPrivilegeList.splice(idx, 1);

View File

@@ -704,7 +704,8 @@ describe('Post\'s', () => {
const cat2 = await categories.create({ name: 'Test Category', description: 'Test category created by testing script' });
const result = await apiTopics.create({ uid: globalModUid }, { title: 'target topic', content: 'queued topic', cid: cat2.cid });
const modUid = await user.create({ username: 'modofcat1' });
await privileges.categories.give(privileges.categories.userPrivilegeList, cat1.cid, modUid);
const userPrivilegeList = await privileges.categories.getUserPrivilegeList();
await privileges.categories.give(userPrivilegeList, cat1.cid, modUid);
let err;
try {
await apiPosts.move({ uid: modUid }, { pid: replyPid, tid: result.tid });