Skip to content

Commit

Permalink
fix(superadmin): remove superadmin and all its references from dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Jul 1, 2024
1 parent 0d3c9b9 commit aa31812
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 126 deletions.
2 changes: 1 addition & 1 deletion dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function importData() {
.option(
'-t, --token <access_token>',
'access token to use for communications',
CONFIG?.access_token
process.env.ACCESS_TOKEN ?? CONFIG?.access_token
)
.option('-i, --ignore', 'ignore errors and don\'t stop', false)
.option('-v, --verbose', 'verbose output', false)
Expand Down
35 changes: 0 additions & 35 deletions datasets/system/data/seed-data/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:address.Address
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-all-hr-scoped
Expand Down Expand Up @@ -42,7 +41,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:command.Command
rules:
- superadministrator-permits-all
- fallback-deny-all
meta:
modifiedBy: ""
Expand All @@ -66,7 +64,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:contact_point_type.ContactPointType
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- permit-read-strict-scoped
- domainless-unauthenticated-permits-read-system
Expand All @@ -93,7 +90,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:contact_point.ContactPoint
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- moderator-permits-all-hr-scoped
Expand Down Expand Up @@ -124,7 +120,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:country.Country
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- permit-read-strict-scoped
Expand Down Expand Up @@ -152,7 +147,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:currency.Currency
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- permit-read-strict-scoped
- domainless-unauthenticated-permits-read-system
Expand All @@ -179,7 +173,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:customer.Customer
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-all-hr-scoped
Expand Down Expand Up @@ -208,7 +201,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:credential.Credental
rules:
- superadministrator-permits-all
- user-permits-all-owned
- fallback-deny-all
meta:
Expand All @@ -233,7 +225,6 @@
- id: urn:restorecommerce:acs:names:model:entity
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
Expand All @@ -260,7 +251,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:fulfillment_product.FulfillmentProduct
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- customer-permits-read-hr-scoped
Expand All @@ -287,7 +277,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:fulfillment.Fulfillment
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-read-hr-scoped
Expand Down Expand Up @@ -315,7 +304,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:invoice.Invoice
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-read-hr-scoped
Expand Down Expand Up @@ -343,7 +331,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:locale.Locale
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- permit-read-strict-scoped
Expand Down Expand Up @@ -371,7 +358,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:manufacturer.Manufacturer
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- customer-permits-read-hr-scoped
Expand Down Expand Up @@ -400,7 +386,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:order.Order
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-all-hr-scoped
Expand Down Expand Up @@ -430,7 +415,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:order.Order
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-requires-order-state-submitted
- user-requires-order-state-pending
Expand All @@ -456,7 +440,6 @@
- id: urn:restorecommerce:acs:names:operation
value: execution.submitOrders
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- customer-requires-order-state-pending
- fallback-deny-all
Expand All @@ -482,7 +465,6 @@
- id: urn:restorecommerce:acs:names:operation
value: execution.withdrawOrders
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-requires-order-state-submitted
- moderator-requires-order-state-submitted
Expand All @@ -509,7 +491,6 @@
- id: urn:restorecommerce:acs:names:operation
value: execution.cancelOrders
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-requires-order-state-submitted
- sales-requires-order-state-withdrawn
Expand All @@ -535,7 +516,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:organization.Organization
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-create-hr-scoped
Expand Down Expand Up @@ -568,7 +548,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:ostorage.Ostorage
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-all-hr-scoped
Expand Down Expand Up @@ -598,7 +577,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:payment_method.PaymentMethod
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- customer-permits-read-hr-scoped
Expand Down Expand Up @@ -627,7 +605,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:payment.Payment
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- moderator-permits-read-hr-scoped
Expand Down Expand Up @@ -655,7 +632,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:price_group.PriceGroup
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- customer-permits-read-hr-scoped
Expand All @@ -682,7 +658,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:product_category.ProductCategory
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- customer-permits-read-hr-scoped
Expand All @@ -709,7 +684,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:product_prototype.ProductPrototype
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- customer-permits-read-hr-scoped
Expand All @@ -736,7 +710,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:product.Product
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- customer-permits-read-hr-scoped
Expand All @@ -763,7 +736,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:role.Role
rules:
- superadministrator-permits-all
- everyone-permits-read
- fallback-deny-all
meta:
Expand All @@ -788,7 +760,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:shop.Shop
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- customer-permits-read-hr-scoped
Expand All @@ -815,7 +786,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:tax_type.TaxType
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- permit-read-strict-scoped
- domainless-unauthenticated-permits-read-system
Expand All @@ -842,7 +812,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:tax.Tax
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- permit-read-strict-scoped
Expand Down Expand Up @@ -870,7 +839,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:timezone.Timezone
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- permit-read-strict-scoped
Expand Down Expand Up @@ -898,7 +866,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:token.Token
rules:
- superadministrator-permits-all
- user-permits-all-owned
- fallback-deny-all
meta:
Expand All @@ -923,7 +890,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:unit_code.UnitCode
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-read-hr-scoped
- permit-read-strict-scoped
Expand Down Expand Up @@ -951,7 +917,6 @@
- id: urn:restorecommerce:acs:names:model:entity
value: urn:restorecommerce:acs:model:user.User
rules:
- superadministrator-permits-all
- administrator-permits-all-hr-scoped
- sales-permits-all-hr-scoped
- moderator-permits-all-hr-scoped
Expand Down
14 changes: 0 additions & 14 deletions datasets/system/data/seed-data/roles.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
---
id: superadministrator-r-id
name: Superadministrator
description: can read and write across all organization scopes
assignableByRoles:
- superadministrator-r-id
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: administrator-r-id
name: Administrator
Expand Down
20 changes: 0 additions & 20 deletions datasets/system/data/seed-data/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,6 @@
attributes:
- id: urn:restorecommerce:acs:names:ownerInstance
value: system
---
id: superadministrator-permits-all
name: SuperAdmin Permits All Rule
description: Permits all if subject is SuperAdmin
target:
subjects:
- id: urn:restorecommerce:acs:names:role
value: superadministrator-r-id
actions: [ ]
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: administrator-permits-all-hr-scoped
name: Admin Permits All Rule HR Scoped
Expand Down
50 changes: 0 additions & 50 deletions datasets/system/data/seed-data/users.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions datasets/system/jobs/job_identity.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
"operation": "sync",
"filter": "roles.yaml",
"mutation": "mutation mutateRoles($var: [IIoRestorecommerceRoleRole!]!){ identity { role { Mutate( input: { items: $var, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } }}"
},
{
"name": "users",
"operation": "sync",
"filter": "users.yaml",
"mutation": "mutation mutateUsers($var: [IIoRestorecommerceUserUser!]!){ identity { user { Mutate( input: { items: $var, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } }}"
}
]
}

0 comments on commit aa31812

Please sign in to comment.