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