mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Add credential runtime checks and prevent tampering in manual run (#4481)
* ✨ Create `PermissionChecker` * ⚡ Adjust helper * 🔥 Remove superseded helpers * ⚡ Use `PermissionChecker` * 🧪 Add test for dynamic router switching * ⚡ Simplify checks * ⚡ Export utils * ⚡ Add missing `init` method * 🧪 Write tests for `PermissionChecker` * 📘 Update types * 🧪 Fix tests * ✨ Set up `runManually()` * ⚡ Refactor to reuse methods * 🧪 Clear shared tables first * 🔀 Adjust merge * ⚡ Adjust imports
This commit is contained in:
@@ -46,10 +46,10 @@ import { getLogger } from '@/Logger';
|
||||
|
||||
import config from '@/config';
|
||||
import { InternalHooksManager } from '@/InternalHooksManager';
|
||||
import { checkPermissionsForExecution } from '@/UserManagement/UserManagementHelper';
|
||||
import { loadClassInIsolation } from '@/CommunityNodes/helpers';
|
||||
import { generateFailedExecutionFromError } from '@/WorkflowHelpers';
|
||||
import { initErrorHandling } from '@/ErrorReporting';
|
||||
import { PermissionChecker } from '@/UserManagement/PermissionChecker';
|
||||
|
||||
export class WorkflowRunnerProcess {
|
||||
data: IWorkflowExecutionDataProcessWithExecution | undefined;
|
||||
@@ -225,7 +225,7 @@ export class WorkflowRunnerProcess {
|
||||
pinData: this.data.pinData,
|
||||
});
|
||||
try {
|
||||
await checkPermissionsForExecution(this.workflow, userId);
|
||||
await PermissionChecker.check(this.workflow, userId);
|
||||
} catch (error) {
|
||||
const caughtError = error as NodeOperationError;
|
||||
const failedExecutionData = generateFailedExecutionFromError(
|
||||
|
||||
Reference in New Issue
Block a user