From 4f5040237be9ac8a4e74bef607dcb632c557f66b Mon Sep 17 00:00:00 2001 From: Christophe Loiseau Date: Thu, 31 Oct 2024 17:04:30 +0100 Subject: [PATCH] add permission to policy --- .../edc/extension/messenger/SovityMessengerExtension.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java b/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java index 3169b535e..eaf64e01e 100644 --- a/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java +++ b/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java @@ -26,6 +26,7 @@ import lombok.val; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.engine.spi.PolicyScope; +import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspHttpRemoteMessageDispatcher; import org.eclipse.edc.protocol.dsp.http.spi.serialization.JsonLdRemoteMessageSerializer; @@ -99,7 +100,7 @@ private void setupSovityMessengerEmitter(ServiceExtensionContext context, Object dspHttpRemoteMessageDispatcher.registerPolicyScope( SovityMessageRequest.class, MESSENGER_SCOPE, - (ignored) -> Policy.Builder.newInstance().build()); + (ignored) -> Policy.Builder.newInstance().permission(Permission.Builder.newInstance().build()).build()); policyEngine.registerPostValidator(MESSENGER_SCOPE, (ignored1, ignored2) -> true);