fix: tests

v1.18.x
Julian Lam 4 years ago
parent 223f0a5515
commit 2874036024

@ -41,7 +41,7 @@ SocketAdmin.before = async function (socket, method) {
}
// Check admin privileges mapping (if not in mapping, deny access)
const privilegeSet = privileges.admin.socketMap[method].split(';');
const privilegeSet = privileges.admin.socketMap.hasOwnProperty(method) ? privileges.admin.socketMap[method].split(';') : [];
const hasPrivilege = (await Promise.all(privilegeSet.map(async privilege => privileges.admin.can(privilege, socket.uid)))).some(Boolean);
if (privilegeSet.length && hasPrivilege) {
return;

Loading…
Cancel
Save