From b4014ac420bb89fae3687a513fd3eab5aadbff10 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 22 Dec 2015 15:02:05 +0200 Subject: [PATCH] closes #3988 --- src/socket.io/user/profile.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/socket.io/user/profile.js b/src/socket.io/user/profile.js index 5a365d6ff2..576276fe81 100644 --- a/src/socket.io/user/profile.js +++ b/src/socket.io/user/profile.js @@ -42,11 +42,10 @@ module.exports = function(SocketUser) { return callback(new Error('[[error:no-privileges]]')); } - user.isAdministrator(socket.uid, function(err, isAdmin) { - if (!isAdmin && data.uid !== socket.uid) { - return callback(new Error('[[error:no-privileges]]')); + user.isAdminOrSelf(socket.uid, data.uid, function(err) { + if (err) { + return callback(err); } - user.removeCoverPicture(data, callback); }); };