wrap makeAxiosRequest under auth

This commit is contained in:
Fendy Heryanto
2026-01-27 08:36:52 +00:00
parent 3cdbcf0044
commit 627a38388b
2 changed files with 9 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ import { MetaTable, RootScopes } from '~/utils/globals';
import { NcError } from '~/helpers/catchError';
import { deepMerge, isEE } from '~/utils';
import Noco from '~/Noco';
import { DataApiLimiterGuard } from '~/guards/data-api-limiter.guard';
@Controller()
export class UtilsController {
@@ -146,8 +147,9 @@ export class UtilsController {
return await this.utilsService.appHealth();
}
@UseGuards(PublicApiLimiterGuard)
@UseGuards(DataApiLimiterGuard, GlobalGuard)
@Post(['/api/v1/db/meta/axiosRequestMake', '/api/v2/meta/axiosRequestMake'])
@Acl('fetchViaUrl')
@HttpCode(200)
async axiosRequestMake(@Body() body: any) {
return await this.utilsService.axiosRequestMake({ body });

View File

@@ -82,6 +82,9 @@ const permissionScopes = {
'mcpRootList',
'getUserProfile',
// etc
'fetchViaUrl',
],
base: [
'nestedDataListCopyPasteOrDeleteAll',
@@ -291,6 +294,9 @@ const rolePermissions:
mcpCreate: true,
mcpUpdate: true,
mcpDelete: true,
// etc
fetchViaUrl: true,
},
},
[ProjectRoles.COMMENTER]: {