From bde4c6c7a19b7275cabbbc3e4d0c5ec14be54769 Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Mon, 11 Mar 2024 09:43:30 +0000 Subject: [PATCH] fix: Allow sharee to use workflows with http request node without credential access (#8841) --- packages/editor-ui/src/composables/useNodeHelpers.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/composables/useNodeHelpers.ts b/packages/editor-ui/src/composables/useNodeHelpers.ts index 00ac6255c1371..b7b431ffd4f27 100644 --- a/packages/editor-ui/src/composables/useNodeHelpers.ts +++ b/packages/editor-ui/src/composables/useNodeHelpers.ts @@ -373,8 +373,15 @@ export function useNodeHelpers() { node.credentials !== undefined ) { const stored = credentialsStore.getCredentialsByType(nodeCredentialType); - - if (selectedCredsDoNotExist(node, nodeCredentialType, stored)) { + // Prevents HTTP Request node from being unusable if a sharee does not have direct + // access to a credential + const isCredentialUsedInWorkflow = + workflowsStore.usedCredentials?.[node.credentials?.[nodeCredentialType]?.id as string]; + + if ( + selectedCredsDoNotExist(node, nodeCredentialType, stored) && + !isCredentialUsedInWorkflow + ) { const credential = credentialsStore.getCredentialTypeByName(nodeCredentialType); return credential ? reportUnsetCredential(credential) : null; }