Skip to content

Commit

Permalink
Revert "Used Duty instead of Permission."
Browse files Browse the repository at this point in the history
This reverts commit 04569cd.
  • Loading branch information
ouphi committed Jul 28, 2022
1 parent 88b51b8 commit 348f871
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,7 +27,7 @@
import java.util.Optional;
import java.util.stream.Collectors;

public class RegionConstraintFunction implements AtomicConstraintFunction<Duty> {
public class RegionConstraintFunction implements AtomicConstraintFunction<Permission> {

private final ObjectMapper objectMapper;
private final Monitor monitor;
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}

}

0 comments on commit 348f871

Please sign in to comment.