fix(core): Fix mcp access scope issue (#22031)

This commit is contained in:
Milorad FIlipović 2025-11-19 19:35:13 +01:00 committed by GitHub
parent ad1e422bab
commit eb6cbfc5e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,15 @@
import { ModuleRegistry, Logger } from '@n8n/backend-common';
import { type AuthenticatedRequest, WorkflowEntity } from '@n8n/db';
import { Body, Post, Get, Patch, RestController, GlobalScope, Param } from '@n8n/decorators';
import {
Body,
Post,
Get,
Patch,
RestController,
GlobalScope,
Param,
ProjectScope,
} from '@n8n/decorators';
import type { Response } from 'express';
import { UpdateMcpSettingsDto } from './dto/update-mcp-settings.dto';
@ -57,7 +66,7 @@ export class McpSettingsController {
return await this.mcpServerApiKeyService.rotateMcpServerApiKey(req.user);
}
@GlobalScope('mcp:manage')
@ProjectScope('workflow:update')
@Patch('/workflows/:workflowId/toggle-access')
async toggleWorkflowMCPAccess(
req: AuthenticatedRequest,