Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Remove deprecated permissions api endpoint #12285

Closed
wants to merge 3 commits into from
Closed
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
18 changes: 0 additions & 18 deletions packages/rocketchat-api/server/v1/permissions.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
/**
This API returns all permissions that exists
on the server, with respective roles.

Method: GET
Route: api/v1/permissions
*/
RocketChat.API.v1.addRoute('permissions', { authRequired: true }, {
get() {
const warningMessage = 'The endpoint "permissions" is deprecated and will be removed after version v0.69';
console.warn(warningMessage);

const result = Meteor.runAsUser(this.userId, () => Meteor.call('permissions/get'));

return RocketChat.API.v1.success(result);
},
});

RocketChat.API.v1.addRoute('permissions.list', { authRequired: true }, {
get() {
const result = Meteor.runAsUser(this.userId, () => Meteor.call('permissions/get'));
Expand Down
20 changes: 0 additions & 20 deletions tests/end-to-end/api/11-permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ describe('[Permissions]', function() {

before((done) => getCredentials(done));

// DEPRECATED
// TODO: Remove this after three versions have been released. That means at 0.69 this should be gone.
describe('[/permissions]', () => {
it('should return all permissions that exists on the server, with respective roles', (done) => {
request.get(api('permissions'))
.set(credentials)
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.be.a('array');

const firstElement = res.body[0];
expect(firstElement).to.have.property('_id');
expect(firstElement).to.have.property('roles').and.to.be.a('array');
expect(firstElement).to.have.property('_updatedAt');
})
.end(done);
});
});

describe('[/permissions.list]', () => {
it('should return all permissions that exists on the server, with respective roles', (done) => {
request.get(api('permissions.list'))
Expand Down