mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
privilege fix for single category check
This commit is contained in:
@@ -21,11 +21,6 @@ helpers.some = function(tasks, callback) {
|
||||
};
|
||||
|
||||
helpers.allowedTo = function(privilege, uid, cids, callback) {
|
||||
|
||||
if (!Array.isArray(cids)) {
|
||||
cids = [cids];
|
||||
}
|
||||
|
||||
if (parseInt(uid, 10) === 0) {
|
||||
return isGuestAllowedTo(privilege, cids, callback);
|
||||
}
|
||||
@@ -61,9 +56,6 @@ helpers.allowedTo = function(privilege, uid, cids, callback) {
|
||||
result.push((!results.userPrivilegeExists[i] && !results.groupPrivilegeExists[i]) || results.hasUserPrivilege[i] || results.hasGroupPrivilege[i]);
|
||||
}
|
||||
|
||||
if (result.length === 1) {
|
||||
result = result[0];
|
||||
}
|
||||
|
||||
callback(null, result);
|
||||
});
|
||||
@@ -100,10 +92,6 @@ function isGuestAllowedTo(privilege, cids, callback) {
|
||||
result.push(!results.userPrivilegeExists[i] && groupPriv);
|
||||
}
|
||||
|
||||
if (result.length === 1) {
|
||||
result = result[0];
|
||||
}
|
||||
|
||||
callback(null, result);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user