Skip to content

Commit

Permalink
chore!: Improve permissions check on oauth-apps endpoints (#32338)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcos Spessatto Defendi <[email protected]>
  • Loading branch information
2 people authored and KevLehman committed Sep 23, 2024
1 parent 0d37e91 commit 80e457d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/meteor/app/api/server/v1/oauthapps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { OAuthApps } from '@rocket.chat/models';
import { isUpdateOAuthAppParams, isOauthAppsGetParams, isOauthAppsAddParams, isDeleteOAuthAppParams } from '@rocket.chat/rest-typings';

import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
import { apiDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
import { addOAuthApp } from '../../../oauth2-server-config/server/admin/functions/addOAuthApp';
import { API } from '../api';
Expand All @@ -20,7 +19,7 @@ API.v1.addRoute(

API.v1.addRoute(
'oauth-apps.get',
{ authRequired: true, validateParams: isOauthAppsGetParams },
{ authRequired: true, validateParams: isOauthAppsGetParams, permissionsRequired: ['manage-oauth-apps'] },
{
async get() {
const isOAuthAppsManager = await hasPermissionAsync(this.userId, 'manage-oauth-apps');
Expand Down

0 comments on commit 80e457d

Please sign in to comment.