mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
fixed #2644
This commit is contained in:
@@ -123,8 +123,13 @@ SocketGroups.delete = function(socket, data, callback) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
groups.ownership.isOwner(socket.uid, data.groupName, function(err, isOwner) {
|
||||
if (!isOwner) {
|
||||
var tasks = {
|
||||
isOwner: async.apply(groups.ownership.isOwner, socket.uid, data.groupName),
|
||||
isAdmin: async.apply(user.isAdministrator, socket.uid)
|
||||
};
|
||||
|
||||
async.parallel(tasks, function(err, checks) {
|
||||
if (!checks.isOwner && !checks.isAdmin) {
|
||||
return callback(new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user