This commit is contained in:
barisusakli
2016-01-11 10:27:26 +02:00
parent d23e6758ba
commit 3ea453e8a0
4 changed files with 23 additions and 11 deletions

View File

@@ -245,11 +245,11 @@ SocketGroups.cover.update = function(socket, data, callback) {
}
groups.ownership.isOwner(socket.uid, data.groupName, function(err, isOwner) {
if (!isOwner) {
return callback(new Error('[[error:no-privileges]]'));
if (err || !isOwner) {
return callback(err || new Error('[[error:no-privileges]]'));
}
groups.updateCover(data, callback);
groups.updateCover(socket.uid, data, callback);
});
};
@@ -259,8 +259,8 @@ SocketGroups.cover.remove = function(socket, data, callback) {
}
groups.ownership.isOwner(socket.uid, data.groupName, function(err, isOwner) {
if (!isOwner) {
return callback(new Error('[[error:no-privileges]]'));
if (err || !isOwner) {
return callback(err || new Error('[[error:no-privileges]]'));
}
groups.removeCover(data, callback);