diff --git a/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/RegionConstraintFunction.java b/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/RegionConstraintFunction.java index ea7f6012..db031238 100644 --- a/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/RegionConstraintFunction.java +++ b/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/RegionConstraintFunction.java @@ -16,8 +16,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.eclipse.dataspaceconnector.identityhub.credentials.model.VerifiableCredential; -import org.eclipse.dataspaceconnector.policy.model.Duty; import org.eclipse.dataspaceconnector.policy.model.Operator; +import org.eclipse.dataspaceconnector.policy.model.Permission; import org.eclipse.dataspaceconnector.spi.monitor.Monitor; import org.eclipse.dataspaceconnector.spi.policy.AtomicConstraintFunction; import org.eclipse.dataspaceconnector.spi.policy.PolicyContext; @@ -27,7 +27,7 @@ import java.util.Optional; import java.util.stream.Collectors; -public class RegionConstraintFunction implements AtomicConstraintFunction { +public class RegionConstraintFunction implements AtomicConstraintFunction { private final ObjectMapper objectMapper; private final Monitor monitor; @@ -38,7 +38,7 @@ public RegionConstraintFunction(ObjectMapper objectMapper, Monitor monitor) { } @Override - public boolean evaluate(Operator operator, Object rightValue, Duty rule, PolicyContext context) { + public boolean evaluate(Operator operator, Object rightValue, Permission rule, PolicyContext context) { var regions = getRegions(context.getParticipantAgent().getClaims()); switch (operator) { case EQ: diff --git a/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/SeedPoliciesExtension.java b/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/SeedPoliciesExtension.java index b2305b12..294457c8 100644 --- a/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/SeedPoliciesExtension.java +++ b/extensions/policies/src/main/java/org/eclipse/dataspaceconnector/mvd/SeedPoliciesExtension.java @@ -14,7 +14,7 @@ package org.eclipse.dataspaceconnector.mvd; -import org.eclipse.dataspaceconnector.policy.model.Duty; +import org.eclipse.dataspaceconnector.policy.model.Permission; import org.eclipse.dataspaceconnector.spi.contract.offer.ContractDefinitionService; import org.eclipse.dataspaceconnector.spi.monitor.Monitor; import org.eclipse.dataspaceconnector.spi.policy.PolicyEngine; @@ -66,7 +66,7 @@ public void initialize(ServiceExtensionContext context) { ruleBindingRegistry.bind("USE", ContractDefinitionService.NEGOTIATION_SCOPE); ruleBindingRegistry.bind(ABS_SPATIAL_POSITION, ContractDefinitionService.NEGOTIATION_SCOPE); - policyEngine.registerFunction(ALL_SCOPES, Duty.class, ABS_SPATIAL_POSITION, new RegionConstraintFunction(typeManager.getMapper(), monitor)); + policyEngine.registerFunction(ALL_SCOPES, Permission.class, ABS_SPATIAL_POSITION, new RegionConstraintFunction(typeManager.getMapper(), monitor)); } }