v1.18.x
Barış Soner Uşaklı 7 years ago
parent 1f8b000530
commit cdc3ef09e9

@ -91,7 +91,7 @@ module.exports = function (Groups) {
return callback(new Error('[[error:group-name-too-long]]'));
}
if (!Groups.isPrivilegeGroup(name) && name.includes(':')) {
if (name === 'guests' || (!Groups.isPrivilegeGroup(name) && name.includes(':'))) {
return callback(new Error('[[error:invalid-group-name]]'));
}

@ -942,6 +942,16 @@ describe('Groups', function () {
});
});
it('should fail to create a group with name guests', function (done) {
var oldValue = meta.config.allowGroupCreation;
meta.config.allowGroupCreation = 1;
socketGroups.create({ uid: adminUid }, { name: 'guests' }, function (err) {
meta.config.allowGroupCreation = oldValue;
assert.equal(err.message, '[[error:invalid-group-name]]');
done();
});
});
it('should fail to rename guests group', function (done) {
var data = {
groupName: 'guests',

Loading…
Cancel
Save