diff --git a/src/management/RolesManager.js b/src/management/RolesManager.js index 36424f384..1e3042804 100644 --- a/src/management/RolesManager.js +++ b/src/management/RolesManager.js @@ -355,7 +355,7 @@ class RolesManager { } if (cb && cb instanceof Function) { - return this.permissions.create(params, data, cb); + return this.users.create(params, data, cb); } return this.users.create(params, data); diff --git a/test/management/roles.tests.js b/test/management/roles.tests.js index 493599541..de166e947 100644 --- a/test/management/roles.tests.js +++ b/test/management/roles.tests.js @@ -671,6 +671,16 @@ describe('RolesManager', () => { }); }); + it('should perform a POST request to /api/v2/roles/rol_ID/users with a callback', function (done) { + const { request } = this; + + this.roles.assignUsers(this.data, {}, () => { + expect(request.isDone()).to.be.true; + + done(); + }); + }); + it('should pass the data in the body of the request', function (done) { nock.cleanAll();