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

chore!: Improve permissions check on licenses endpoints #32354

Merged
merged 20 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5cea67f
chore: bump 7.0.0
ggazzo Apr 8, 2024
9b3d017
fix!: api login should not suggest which credential is wrong (#32159)
ggazzo Apr 9, 2024
8d5b603
chore!: remove hipchat importer (#32154)
pierre-lehnen-rc Apr 11, 2024
c2ab323
chore!: Removed Mongo 4.4. support and added 7.0 (#32162)
ggazzo Apr 12, 2024
68fee68
rebase with mongo
ggazzo Apr 24, 2024
1e16a7e
chore: Improve permissions check on licenses endpoints
matheusbsilva137 Apr 30, 2024
94b238d
chore: bump 7.0.0
ggazzo Apr 8, 2024
fcc9265
fix!: api login should not suggest which credential is wrong (#32159)
ggazzo Apr 9, 2024
cd0313b
chore!: remove hipchat importer (#32154)
pierre-lehnen-rc Apr 11, 2024
405da2a
chore!: Removed Mongo 4.4. support and added 7.0 (#32162)
ggazzo Apr 12, 2024
ce31b9d
rebase with mongo
ggazzo Apr 24, 2024
1c13d06
chore!: Improve permissions check on channels endpoints (#32330)
matheusbsilva137 May 3, 2024
8f45647
chore: Improve permissions check on cloud endpoints (#32331)
matheusbsilva137 May 3, 2024
ecaa003
chore: Improve permissions check on instances endpoints (#32334)
matheusbsilva137 May 3, 2024
5ee72d7
chore: Improve permissions check on LDAP endpoints (#32335)
matheusbsilva137 May 3, 2024
cb2fa7f
chore!: Improve permissions check on mailer endpoints (#32336)
matheusbsilva137 May 3, 2024
c42eef9
chore: Improve permissions check on users endpoints (#32353)
matheusbsilva137 May 7, 2024
c35b3b5
Merge branch 'release-7.0.0' into chore/permissions-check-license
matheusbsilva137 May 7, 2024
876adc2
Merge branch 'release-7.0.0' into chore/permissions-check-license
matheusbsilva137 May 10, 2024
0b7cf6c
revert licenses.get related changes
matheusbsilva137 May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions apps/meteor/ee/server/api/licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,13 @@ API.v1.addRoute(

API.v1.addRoute(
'licenses.add',
{ authRequired: true },
{ authRequired: true, permissionsRequired: ['edit-privileged-setting'] },
{
async post() {
check(this.bodyParams, {
license: String,
});

if (!(await hasPermissionAsync(this.userId, 'edit-privileged-setting'))) {
return API.v1.unauthorized();
}

const { license } = this.bodyParams;
if (!(await License.validateFormat(license))) {
return API.v1.failure('Invalid license');
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/end-to-end/api/20-licenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('licenses', function () {
.expect(403)
.expect((res) => {
expect(res.body).to.have.property('success', false);
expect(res.body).to.have.property('error', 'unauthorized');
expect(res.body).to.have.property('error', 'User does not have the permissions required for this action [error-unauthorized]');
})
.end(done);
});
Expand Down