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