Skip to content

Node.js based forum software built for the modern web

closes #3988

barisusaklib4014ac420bb
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);
});
};