Allow usernames and groupnames of length 1

Fixes #204
This commit is contained in:
Girish Ramakrishnan
2017-02-02 00:23:11 -08:00
parent cd31e12bec
commit 7efb6d60bc
6 changed files with 17 additions and 20 deletions

View File

@@ -60,7 +60,7 @@ GroupError.NOT_ALLOWED = 'Not Allowed';
function validateGroupname(name) {
assert.strictEqual(typeof name, 'string');
if (name.length < 2) return new GroupError(GroupError.BAD_FIELD, 'name must be atleast 2 chars');
if (name.length < 1) return new GroupError(GroupError.BAD_FIELD, 'name must be atleast 1 char');
if (name.length >= 200) return new GroupError(GroupError.BAD_FIELD, 'name too long');
if (constants.RESERVED_NAMES.indexOf(name) !== -1) return new GroupError(GroupError.BAD_FIELD, 'name is reserved');