mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
test: add missing tests
This commit is contained in:
@@ -185,11 +185,9 @@ helpers.giveOrRescind = async function (method, privileges, cids, members) {
|
||||
};
|
||||
|
||||
helpers.userOrGroupPrivileges = async function (cid, uidOrGroup, privilegeList) {
|
||||
const tasks = {};
|
||||
privilegeList.forEach((privilege) => {
|
||||
tasks[privilege] = groups.isMember(uidOrGroup, `cid:${cid}:privileges:${privilege}`);
|
||||
});
|
||||
return await utils.promiseParallel(tasks);
|
||||
const groupNames = privilegeList.map(privilege => `cid:${cid}:privileges:${privilege}`);
|
||||
const isMembers = await groups.isMemberOfGroups(uidOrGroup, groupNames);
|
||||
return _.zipObject(privilegeList, isMembers);
|
||||
};
|
||||
|
||||
require('../promisify')(helpers);
|
||||
|
||||
Reference in New Issue
Block a user