mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
server side check so you can't leave admin group
This commit is contained in:
@@ -43,6 +43,10 @@ SocketGroups.leave = function(socket, data, callback) {
|
||||
return callback(new Error('[[error:invalid-uid]]'));
|
||||
}
|
||||
|
||||
if (data.groupName === 'administrators') {
|
||||
return callback(new Error('[[error:cant-remove-self-as-admin]]'));
|
||||
}
|
||||
|
||||
groups.leave(data.groupName, socket.uid, callback);
|
||||
};
|
||||
|
||||
@@ -131,7 +135,7 @@ function acceptRejectAll(type, socket, data, callback) {
|
||||
}
|
||||
], callback);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
SocketGroups.issueInvite = function(socket, data, callback) {
|
||||
if (!data) {
|
||||
|
||||
Reference in New Issue
Block a user