diff --git a/core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java b/core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java index b0403d06463..e77d56f4f7c 100644 --- a/core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java +++ b/core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java @@ -97,7 +97,6 @@ Duty applyScope(Duty duty, String scope) { return Duty.Builder.newInstance() .action(duty.getAction()) .constraints(filteredConstraints) - .parentPermission(duty.getParentPermission()) .consequences(filteredConsequences) .build(); } diff --git a/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Duty.java b/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Duty.java index e1754fd9ce2..211bdf41ad8 100644 --- a/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Duty.java +++ b/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Duty.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; -import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; @@ -33,25 +32,12 @@ @JsonTypeName("dataspaceconnector:duty") public class Duty extends Rule { - private Permission parentPermission; private final List consequences = new ArrayList<>(); - /** - * If this duty is part of a permission, returns the parent permission; otherwise returns null. - */ - @Nullable - public Permission getParentPermission() { - return parentPermission; - } - public List getConsequences() { return consequences; } - void setParentPermission(Permission permission) { - parentPermission = permission; - } - @Override public R accept(Visitor visitor) { return visitor.visitDuty(this); @@ -74,11 +60,6 @@ public static Builder newInstance() { return new Builder(); } - public Builder parentPermission(Permission parentPermission) { - rule.parentPermission = parentPermission; - return this; - } - public Builder consequence(Duty consequence) { rule.consequences.add(consequence); return this; diff --git a/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Permission.java b/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Permission.java index 39536e38845..12df72b3cd5 100644 --- a/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Permission.java +++ b/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/Permission.java @@ -60,15 +60,11 @@ public static Builder newInstance() { } public Builder duty(Duty duty) { - duty.setParentPermission(rule); rule.duties.add(duty); return this; } public Builder duties(List duties) { - for (var duty : duties) { - duty.setParentPermission(rule); - } rule.duties.addAll(duties); return this; }