SilverStripe\Security\Permission:
  admin-perm:
    Code: ADMIN
  run-instance-perm:
    Code: PRODUCT_INSTANCE_CREATE
  delete-instance-perm:
    Code: PRODUCT_INSTANCE_DELETE

SilverStripe\Security\Group:
  admins:
    Code: 'administrators'
    Permissions: =>SilverStripe\Security\Permission.admin-perm
  users:
    Code: 'users'
  users-with-run-instance:
    Code: 'users'
    Permissions: =>SilverStripe\Security\Permission.run-instance-perm
  users-with-no-run-instance:
    Code: 'users'
  users-with-delete-instance:
    Code: 'users'
    Permissions: =>SilverStripe\Security\Permission.delete-instance-perm
  users-with-no-delete-instance:
    Code: 'users'

Country:
  country-nz:
    Name: 'New Zealand'
    Code: NZ
  country-tv:
    Name: 'Tuvalu'
    Code: TV

Bundle:
  master:
    Name: Master
    Groups: =>SilverStripe\Security\Group.admins
  not-master:
    Name: 'Not Master'
    Groups: =>SilverStripe\Security\Group.users-with-no-run-instance
  other:
    Name: 'Other'
    Groups: =>SilverStripe\Security\Group.users-with-run-instance

Script:
  test-dummy:
    ID: 4444
    Type: sh
    Name: 'test.sh'

ProductGenerator:
  generator-dummy:
    Active: 1
    Initialised: 1
    PrimaryScript: =>Script.test-dummy
  generator-dummy-no-script:
    Active: 1
    Initialised: 1
  generator-nz:
    Country: =>Country.country-nz
    Active: 1
    Initialised: 1
    PrimaryScript: =>Script.test-dummy
    Bundles: =>Bundle.other
  generator-tv:
    Country: =>Country.country-tv
    Active: 1
    Initialised: 1
    PrimaryScript: =>Script.test-dummy
  generator-no-perms:
    Country: =>Country.country-nz
    Active: 1
    Initialised: 1
    PrimaryScript: =>Script.test-dummy

ProductInstance:
  instance-dummy:
    Generator: =>ProductGenerator.generator-dummy
  instance-dummy-no-script:
    Generator: =>ProductGenerator.generator-dummy-no-script
  instance-country-nz:
    Generator: =>ProductGenerator.generator-nz
  instance-country-tv:
    Generator: =>ProductGenerator.generator-tv
  instance-no-perms:
    Generator: =>ProductGenerator.generator-no-perms

SilverStripe\Security\Member:
  admin:
    Groups: =>SilverStripe\Security\Group.admins
  user:
    Groups: =>SilverStripe\Security\Group.users
  user-can-run-instance:
    Groups: =>SilverStripe\Security\Group.users-with-run-instance
    Countries: =>Country.country-nz
  user-not-run-instance-perms:
    Groups: =>SilverStripe\Security\Group.users-with-no-run-instance
  user-not-run-instance-country-nz:
    Groups: =>SilverStripe\Security\Group.users-with-run-instance
    Countries: =>Country.country-nz
  user-can-delete-instance:
    Groups: =>SilverStripe\Security\Group.users-with-delete-instance
    Countries: =>Country.country-nz
  # User cannot delete, due to permissions mismatch
  user-not-delete-instance-perms:
    Groups: =>SilverStripe\Security\Group.users-with-no-delete-instance
    Countries: =>Country.country-nz
  # User cannot delete, due to country mismatch
  user-not-delete-instance-country-nz:
    Groups: =>SilverStripe\Security\Group.users-with-no-delete-instance
    Countries: =>Country.country-tv
