Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions policy/policy-01-policy-enforcement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,15 @@ to the negotiation scope anymore, the negotiation will be terminated. When recei
the provider will still evaluate its contract definitions' access policies using the catalog scope, to ensure that
a consumer cannot negotiate an offer it is not allowed to see.


```java
ruleBindingRegistry.bind(LOCATION_CONSTRAINT_KEY, CATALOG_SCOPE);
policyEngine.registerFunction(CatalogPolicyContext.class, Permission.class, LOCATION_CONSTRAINT_KEY, new LocationConstraintFunction(monitor));
```

Let's change ContractNegotiationPolicyContext with CatalogPolicyContext in LocationConstraintFunction.java

```java
ruleBindingRegistry.bind(LOCATION_CONSTRAINT_KEY, CATALOGING_SCOPE);
policyEngine.registerFunction(CATALOGING_SCOPE, Permission.class, LOCATION_CONSTRAINT_KEY, new LocationConstraintFunction(monitor));
public class LocationConstraintFunction implements AtomicConstraintRuleFunction<Permission, CatalogPolicyContext>
public boolean evaluate(Operator operator, Object rightValue, Permission rule, CatalogPolicyContext context)
```