Skip to content

Commit 0c74143

Browse files
committed
Id in createRestrictedUser no longer mandatory
1 parent e1899ad commit 0c74143

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

src/security/Security.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,6 @@ Security.prototype.createRestrictedUser = function (id, content, options, cb) {
615615
self = this,
616616
data = {_id: id, body: content};
617617

618-
if (!id || typeof id !== 'string') {
619-
throw new Error('Security.createRestrictedUser: cannot create a user without a user ID');
620-
}
621-
622618
if (content.profileIds) {
623619
throw new Error('Security.createRestrictedUser: cannot provide profileIds');
624620
}

test/security/kuzzleSecurity/userMethods.test.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,6 @@ describe('Security user methods', function () {
204204
should(kuzzle.query).calledWith(expectedQuery, {_id: 'foobar', body: content}, null, undefined);
205205
});
206206

207-
it('should throw an error if no id provided', function () {
208-
should(function () { kuzzle.security.createRestrictedUser(null); }).throw(Error);
209-
should(kuzzle.query).not.be.called();
210-
});
211-
212207
it('should throw an error if profileIds is provided', function () {
213208
should(function () { kuzzle.security.createRestrictedUser('foobar', {profileIds: ['someProfile']}); }).throw(Error);
214209
should(kuzzle.query).not.be.called();

0 commit comments

Comments
 (0)