Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fresh-tables-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': major
---

Removes the deprecated `getUserRoles` method in favor of the `/v1/roles.getUsersInPublicRoles` endpoint.
1 change: 0 additions & 1 deletion apps/meteor/app/lib/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import './methods/getSingleMessage';
import './methods/getMessages';
import './methods/getSlashCommandPreviews';
import './methods/getUsernameSuggestion';
import './methods/getUserRoles';
import './methods/joinDefaultChannels';
import './methods/joinRoom';
import './methods/leaveRoom';
Expand Down
29 changes: 0 additions & 29 deletions apps/meteor/app/lib/server/methods/getUserRoles.ts

This file was deleted.

46 changes: 0 additions & 46 deletions apps/meteor/tests/end-to-end/api/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,52 +1314,6 @@ describe('Meteor.methods', () => {
});
});

describe('[@getUserRoles]', () => {
it('should fail if not logged in', (done) => {
void request
.post(methodCall('getUserRoles'))
.send({
message: JSON.stringify({
method: 'getUserRoles',
params: [],
id: 'id',
msg: 'method',
}),
})
.expect('Content-Type', 'application/json')
.expect(401)
.expect((res) => {
expect(res.body).to.have.property('status', 'error');
expect(res.body).to.have.property('message');
})
.end(done);
});

it('should return the roles for the current user', (done) => {
void request
.post(methodCall('getUserRoles'))
.set(credentials)
.send({
message: JSON.stringify({
method: 'getUserRoles',
params: [],
id: 'id',
msg: 'method',
}),
})
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.a.property('success', true);
expect(res.body).to.have.a.property('message').that.is.a('string');

const data = JSON.parse(res.body.message);
expect(data).to.have.a.property('result').that.is.an('array');
})
.end(done);
});
});

describe('[@listCustomUserStatus]', () => {
it('should fail if not logged in', (done) => {
void request
Expand Down
Loading