v1.18.x
barisusakli 9 years ago
parent 85c1683a25
commit b4014ac420

@ -42,11 +42,10 @@ module.exports = function(SocketUser) {
return callback(new Error('[[error:no-privileges]]')); return callback(new Error('[[error:no-privileges]]'));
} }
user.isAdministrator(socket.uid, function(err, isAdmin) { user.isAdminOrSelf(socket.uid, data.uid, function(err) {
if (!isAdmin && data.uid !== socket.uid) { if (err) {
return callback(new Error('[[error:no-privileges]]')); return callback(err);
} }
user.removeCoverPicture(data, callback); user.removeCoverPicture(data, callback);
}); });
}; };

Loading…
Cancel
Save