From 30c814f78ce3e0a50954fe3805aec283884c6746 Mon Sep 17 00:00:00 2001 From: Gerald Baulig Date: Tue, 7 May 2024 14:50:04 +0200 Subject: [PATCH] fix(fulfillment): add courier and product samples, fix fulfillment rules --- .../sample-data/fulfillment_couriers.yaml | 21 ++++++++++++++ .../fulfillment_products.yaml | 8 +++--- .../data/seed-data/fulfillment_couriers.yaml | 20 ------------- datasets/system/data/seed-data/policies.yaml | 6 +--- datasets/system/data/seed-data/rules.yaml | 28 ------------------- 5 files changed, 26 insertions(+), 57 deletions(-) create mode 100644 datasets/demo-shop/data/sample-data/fulfillment_couriers.yaml rename datasets/demo-shop/data/{seed-data => sample-data}/fulfillment_products.yaml (71%) delete mode 100644 datasets/demo-shop/data/seed-data/fulfillment_couriers.yaml diff --git a/datasets/demo-shop/data/sample-data/fulfillment_couriers.yaml b/datasets/demo-shop/data/sample-data/fulfillment_couriers.yaml new file mode 100644 index 0000000..0a3ee3f --- /dev/null +++ b/datasets/demo-shop/data/sample-data/fulfillment_couriers.yaml @@ -0,0 +1,21 @@ +--- + id: restorecommerce-demo-shop-courier-000 + shopIds: + - restorecommerce-demo-shop-000 + name: In House Courier + description: Fulfillments operated by us + logo: "" + website: "" + stubType: Dummy + configuration: + typeUrl: "" + value: + test: "123" + meta: + owners: + - id: urn:restorecommerce:acs:names:ownerIndicatoryEntity + value: urn:restorecommerce:acs:model:organization.Organization + attributes: + - id: urn:restorecommerce:acs:names:ownerInstance + value: restorecommerce-demo-shop-000-organization +--- \ No newline at end of file diff --git a/datasets/demo-shop/data/seed-data/fulfillment_products.yaml b/datasets/demo-shop/data/sample-data/fulfillment_products.yaml similarity index 71% rename from datasets/demo-shop/data/seed-data/fulfillment_products.yaml rename to datasets/demo-shop/data/sample-data/fulfillment_products.yaml index 049d742..bd42ba1 100644 --- a/datasets/demo-shop/data/seed-data/fulfillment_products.yaml +++ b/datasets/demo-shop/data/sample-data/fulfillment_products.yaml @@ -27,9 +27,9 @@ attributes: [ ] meta: owners: - - id: 'urn:restorecommerce:acs:names:ownerIndicatoryEntity' - value: 'urn:restorecommerce:acs:model:organization.Organization' + - id: urn:restorecommerce:acs:names:ownerIndicatoryEntity + value: urn:restorecommerce:acs:model:organization.Organization attributes: - - id: 'urn:restorecommerce:acs:names:ownerInstance' - value: restorecommecre-demo-shop-000-organization + - id: urn:restorecommerce:acs:names:ownerInstance + value: restorecommerce-demo-shop-000-organization --- \ No newline at end of file diff --git a/datasets/demo-shop/data/seed-data/fulfillment_couriers.yaml b/datasets/demo-shop/data/seed-data/fulfillment_couriers.yaml deleted file mode 100644 index cb4417d..0000000 --- a/datasets/demo-shop/data/seed-data/fulfillment_couriers.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- - id: restorecommerce-demo-shop-courier-000 - shopIds: - - restorecommerce-demo-shop-000 - name: In House Courier - description: Fulfillments operated by us - logo: "" - website: "" - stubType: DummyStub - configuration: - typeUrl: "" - value: "" - meta: - owners: - - id: 'urn:restorecommerce:acs:names:ownerIndicatoryEntity' - value: 'urn:restorecommerce:acs:model:organization.Organization' - attributes: - - id: 'urn:restorecommerce:acs:names:ownerInstance' - value: restorecommecre-demo-shop-000-organization ---- \ No newline at end of file diff --git a/datasets/system/data/seed-data/policies.yaml b/datasets/system/data/seed-data/policies.yaml index 0ba3c3b..9ea85e7 100644 --- a/datasets/system/data/seed-data/policies.yaml +++ b/datasets/system/data/seed-data/policies.yaml @@ -206,14 +206,12 @@ subjects: [ ] resources: - id: urn:restorecommerce:acs:names:model:entity - value: urn:restorecommerce:acs:model:fulfillment_courier.FulfillmentCounrier + value: urn:restorecommerce:acs:model:fulfillment_courier.FulfillmentCourier rules: - superadministrator-permits-all - administrator-permits-all-hr-scoped - sales-permits-read-hr-scoped - customer-permits-read-hr-scoped - - permit-read-strict-scoped - - domainless-unauthenticated-permits-read-system - fallback-deny-all meta: modifiedBy: "" @@ -241,8 +239,6 @@ - administrator-permits-all-hr-scoped - sales-permits-read-hr-scoped - customer-permits-read-hr-scoped - - permit-read-strict-scoped - - domainless-unauthenticated-permits-read-system - fallback-deny-all meta: modifiedBy: "" diff --git a/datasets/system/data/seed-data/rules.yaml b/datasets/system/data/seed-data/rules.yaml index e802de3..62603cc 100644 --- a/datasets/system/data/seed-data/rules.yaml +++ b/datasets/system/data/seed-data/rules.yaml @@ -47,7 +47,6 @@ actions: [ ] resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -70,7 +69,6 @@ actions: [ ] resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -95,7 +93,6 @@ - id: urn:oasis:names:tc:xacml:1.0:action:action-id value: urn:restorecommerce:acs:names:action:read effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -118,7 +115,6 @@ actions: [ ] resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -143,7 +139,6 @@ - id: urn:oasis:names:tc:xacml:1.0:action:action-id value: urn:restorecommerce:acs:names:action:read effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -166,7 +161,6 @@ actions: [ ] resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -191,7 +185,6 @@ - id: urn:oasis:names:tc:xacml:1.0:action:action-id value: urn:restorecommerce:acs:names:action:read effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -216,7 +209,6 @@ - id: urn:oasis:names:tc:xacml:1.0:action:action-id value: urn:restorecommerce:acs:names:action:create effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -241,7 +233,6 @@ - id: urn:oasis:names:tc:xacml:1.0:action:action-id value: urn:restorecommerce:acs:names:action:update effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -266,7 +257,6 @@ - id: urn:oasis:names:tc:xacml:1.0:action:action-id value: urn:restorecommerce:acs:names:action:read effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -291,7 +281,6 @@ - id: urn:oasis:names:tc:xacml:1.0:action:action-id value: urn:restorecommerce:acs:names:action:read effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -316,12 +305,6 @@ actions: [ ] resources: [ ] effect: PERMIT - condition: " - !context?.resources?.some( - resource => resource?.user_id !== context.subject?.id - || resource?.private?.user_id !== context.subject?.id - ) - " evaluationCacheable: false meta: modifiedBy: "" @@ -348,12 +331,6 @@ value: urn:restorecommerce:acs:names:action:create resources: [ ] effect: PERMIT - condition: " - !context?.resources?.some( - resource => resource?.user_id !== context.subject?.id - || resource?.private?.user_id !== context.subject?.id - ) - " evaluationCacheable: false meta: modifiedBy: "" @@ -380,7 +357,6 @@ value: urn:restorecommerce:acs:names:action:update resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -405,7 +381,6 @@ value: urn:restorecommerce:acs:names:action:read resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -432,7 +407,6 @@ value: urn:restorecommerce:acs:names:action:read resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -459,7 +433,6 @@ value: urn:restorecommerce:acs:names:action:create resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: "" @@ -484,7 +457,6 @@ value: urn:restorecommerce:acs:names:action:update resources: [ ] effect: PERMIT - condition: "" evaluationCacheable: false meta: modifiedBy: ""