Cover photo removal for groups, #3832

This commit is contained in:
Julian Lam
2015-11-06 10:50:14 -05:00
parent 92be63ebe6
commit 2830538835
4 changed files with 33 additions and 2 deletions

View File

@@ -242,4 +242,18 @@ SocketGroups.cover.update = function(socket, data, callback) {
});
};
SocketGroups.cover.remove = function(socket, data, callback) {
if (!socket.uid) {
return callback(new Error('[[error:no-privileges]]'));
}
groups.ownership.isOwner(socket.uid, data.groupName, function(err, isOwner) {
if (!isOwner) {
return callback(new Error('[[error:no-privileges]]'));
}
groups.removeCover(data, callback);
});
}
module.exports = SocketGroups;