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

View File

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