++Strette di Mano
This commit is contained in:
@@ -684,7 +684,12 @@ router.post('/friends/cmd', authenticate, async (req, res) => {
|
||||
|
||||
if (!User.isAdmin(req.user.perm) || !User.isManager(req.user.perm)) {
|
||||
// If without permissions, exit
|
||||
if (usernameOrig !== usernameLogged) {
|
||||
if ((usernameOrig !== usernameLogged) && (
|
||||
(usernameDest !== usernameLogged) &&
|
||||
((cmd === shared_consts.FRIENDSCMD.SETFRIEND) ||
|
||||
(cmd === shared_consts.FRIENDSCMD.SETHANDSHAKE))
|
||||
|
||||
)) {
|
||||
return res.status(404).
|
||||
send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user