
# yaml-language-server: $schema=https://api.cerbos.dev/latest/cerbos/policy/v1/TestSuite.schema.json
---
resources:
  sound_recording:
    id: "nr_sound_recording"
    kind: "sound_recording"
    attr:
      tenant:
        tenant_uuid: "77c6c150-19f3-451f-a692-1a5d7ef30e85"
        tenant_type: "company_brand"
        tenant_hierarchy: ["77c6c150-19f3-451f-a692-1a5d7ef30e85"]

name: SoundRecordingTestSuite
description: Test for verifying sound recording resource policies
tests:
  - name: Viewing a sound recording
    input:
      principals:
        - rob
        - allan
        - georgios
        - kath
        - alex
      resources:
        - sound_recording
      actions:
        - view
    expected:
      - principal: rob
        resource: sound_recording
        actions:
          view: EFFECT_ALLOW
      - principal: allan
        resource: sound_recording
        actions:
          view: EFFECT_DENY
      - principal: georgios
        resource: sound_recording
        actions:
          view: EFFECT_ALLOW
      - principal: kath
        resource: sound_recording
        actions:
          view: EFFECT_ALLOW
      - principal: alex
        resource: sound_recording
        actions:
          view: EFFECT_ALLOW
  - name: Managing a sound recording
    input:
      principals:
        - rob
        - allan
        - georgios
        - kath
        - alex
      resources:
        - sound_recording
      actions:
        - edit
    expected:
      - principal: rob
        resource: sound_recording
        actions:
          edit: EFFECT_DENY
      - principal: allan
        resource: sound_recording
        actions:
          edit: EFFECT_DENY
      - principal: georgios
        resource: sound_recording
        actions:
          edit: EFFECT_ALLOW
      - principal: kath
        resource: sound_recording
        actions:
          edit: EFFECT_ALLOW
      - principal: alex
        resource: sound_recording
        actions:
          edit: EFFECT_ALLOW
