privilege fix for single category check

This commit is contained in:
barisusakli
2014-08-02 19:45:13 -04:00
parent e7700a3fde
commit e420ee5fb6
7 changed files with 62 additions and 76 deletions

View File

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