server side check so you can't leave admin group

This commit is contained in:
barisusakli
2015-07-28 13:26:52 -04:00
parent eac92b00c6
commit 05411651b3

View File

@@ -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) {