Skip to content

Commit

Permalink
fix(unauth): add customer of each sector to unauth user and fix rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Jul 29, 2024
1 parent 32c23a5 commit 30fd712
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
32 changes: 28 additions & 4 deletions datasets/demo-shop/data/seed-data/customers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
---
id: restorecommerce-demo-customer-002
private:
userId: restorecommerce-demo-customer-002-user
userId: restorecommerce-demo-customer-002-user-000
contactPointIds: [
restorecommerce-demo-customer-002-contact-point
]
Expand All @@ -38,15 +38,39 @@
- id: urn:restorecommerce:acs:names:ownerInstance
value: restorecommerce-demo-customer-002-user-000
---
id: restorecommerce-demo-customer-unauthenticated
id: restorecommerce-demo-customer-unauthenticated-private
private:
userId: restorecommerce-demo-unauthenticated-user
contactPointIds: []
meta:
modifiedBy: ""
owners:
- id: urn:restorecommerce:acs:names:ownerIndicatoryEntity
value: urn:restorecommerce:acs:model:organization.Organization
value: urn:restorecommerce:acs:model:user.User
attributes:
- id: urn:restorecommerce:acs:names:ownerInstance
value: restorecommerce-demo-unauthenticated-user
---
id: restorecommerce-demo-customer-unauthenticated-commercial
commercial:
organizationId: ""
meta:
modifiedBy: ""
owners:
- id: urn:restorecommerce:acs:names:ownerIndicatoryEntity
value: urn:restorecommerce:acs:model:user.User
attributes:
- id: urn:restorecommerce:acs:names:ownerInstance
value: restorecommerce-demo-unauthenticated-user
---
id: restorecommerce-demo-customer-unauthenticated-public-sector
publicSector:
organizationId: ""
meta:
modifiedBy: ""
owners:
- id: urn:restorecommerce:acs:names:ownerIndicatoryEntity
value: urn:restorecommerce:acs:model:user.User
attributes:
- id: urn:restorecommerce:acs:names:ownerInstance
value: restorecommerce-demo-root-organization
value: restorecommerce-demo-unauthenticated-user
1 change: 1 addition & 0 deletions datasets/system/data/seed-data/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
- moderator-permits-all-hr-scoped
- member-permits-read-hr-scoped
- user-permits-all-owned
- unauthenticated-user-permits-read-owned
- fallback-deny-all
meta:
modifiedBy: ""
Expand Down
24 changes: 24 additions & 0 deletions datasets/system/data/seed-data/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,30 @@
attributes:
- id: urn:restorecommerce:acs:names:ownerInstance
value: system
---
id: unauthenticated-user-permits-read-owned
name: Unauthenticated User Permits Read Owned
description: Permits read if resource is owned by unauthenticated subject
target:
subjects:
- id: urn:restorecommerce:acs:names:role
value: unauthenticated-r-id
- id: urn:restorecommerce:acs:names:roleScopingEntity
value: urn:restorecommerce:acs:model:user.User
actions:
- id: urn:oasis:names:tc:xacml:1.0:action:action-id
value: urn:restorecommerce:acs:names:action:read
resources: [ ]
effect: PERMIT
evaluationCacheable: false
meta:
modifiedBy: ""
owners:
- id: urn:restorecommerce:acs:names:ownerIndicatoryEntity
value: urn:restorecommerce:acs:model:organization.Organization
attributes:
- id: urn:restorecommerce:acs:names:ownerInstance
value: system
---
id: domainless-unauthenticated-permits-read-system
name: Domainless Unauthenticated Permits Read System
Expand Down

0 comments on commit 30fd712

Please sign in to comment.