mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-01 22:08:33 +00:00
wrap makeAxiosRequest under auth
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -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]: {
|
||||
|
||||
Reference in New Issue
Block a user