mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
closes #4424
This commit is contained in:
@@ -178,16 +178,16 @@ SocketGroups.create = function(socket, data, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SocketGroups.delete = function(socket, data, callback) {
|
SocketGroups.delete = function(socket, data, callback) {
|
||||||
if (data.groupName === 'administrators' || data.groupName === 'registered-users') {
|
if (data.groupName === 'administrators' ||
|
||||||
|
data.groupName === 'registered-users' ||
|
||||||
|
data.groupName === 'Global Moderators') {
|
||||||
return callback(new Error('[[error:not-allowed]]'));
|
return callback(new Error('[[error:not-allowed]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
var tasks = {
|
async.parallel({
|
||||||
isOwner: async.apply(groups.ownership.isOwner, socket.uid, data.groupName),
|
isOwner: async.apply(groups.ownership.isOwner, socket.uid, data.groupName),
|
||||||
isAdmin: async.apply(user.isAdministrator, socket.uid)
|
isAdmin: async.apply(user.isAdministrator, socket.uid)
|
||||||
};
|
}, function(err, checks) {
|
||||||
|
|
||||||
async.parallel(tasks, function(err, checks) {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user