From 1c2c31af2cfb963cadb6760fa0258ebb2b1419c8 Mon Sep 17 00:00:00 2001 From: Damien Coraboeuf Date: Sat, 30 Nov 2024 09:50:43 +0100 Subject: [PATCH] #1363 Missing rights for the AV workflow node executor --- .../av/workflows/AutoVersioningWorkflowNodeExecutor.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ontrack-extension-auto-versioning/src/main/java/net/nemerosa/ontrack/extension/av/workflows/AutoVersioningWorkflowNodeExecutor.kt b/ontrack-extension-auto-versioning/src/main/java/net/nemerosa/ontrack/extension/av/workflows/AutoVersioningWorkflowNodeExecutor.kt index 289abaedfd..20602a468a 100644 --- a/ontrack-extension-auto-versioning/src/main/java/net/nemerosa/ontrack/extension/av/workflows/AutoVersioningWorkflowNodeExecutor.kt +++ b/ontrack-extension-auto-versioning/src/main/java/net/nemerosa/ontrack/extension/av/workflows/AutoVersioningWorkflowNodeExecutor.kt @@ -14,6 +14,7 @@ import net.nemerosa.ontrack.model.events.Event import net.nemerosa.ontrack.model.events.EventTemplatingService import net.nemerosa.ontrack.model.events.PlainEventRenderer import net.nemerosa.ontrack.model.events.SerializableEventService +import net.nemerosa.ontrack.model.security.SecurityService import net.nemerosa.ontrack.model.structure.Branch import net.nemerosa.ontrack.model.structure.Build import net.nemerosa.ontrack.model.structure.ProjectEntityType @@ -27,6 +28,7 @@ class AutoVersioningWorkflowNodeExecutor( extensionFeature: AutoVersioningExtensionFeature, private val autoVersioningProcessingService: AutoVersioningProcessingService, private val structureService: StructureService, + private val securityService: SecurityService, private val eventTemplatingService: EventTemplatingService, private val serializableEventService: SerializableEventService, private val autoVersioningAuditService: AutoVersioningAuditService, @@ -42,7 +44,9 @@ class AutoVersioningWorkflowNodeExecutor( data: AutoVersioningWorkflowNodeExecutorData, workflowNodeExecutorResultFeedback: (output: JsonNode?) -> Unit ): WorkflowNodeExecutorResult { - val order = createOrder(workflowInstance, data) + val order = securityService.asAdmin { + createOrder(workflowInstance, data) + } val output = AutoVersioningWorkflowNodeExecutorOutput( autoVersioningOrderId = order.uuid, )