mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 08:55:59 +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 { 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 });
|
||||||
|
|||||||
@@ -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]: {
|
||||||
|
|||||||
Reference in New Issue
Block a user