# yaml-language-server: $schema=https://api.cerbos.dev/latest/cerbos/policy/v1/TestSuite.schema.json
---
resources:
  contributor_only_schedule:
    id: "a_schedule"
    kind: "abacus_schedule"

name: AbacusScheduleTestSuite
description: Test for verifying abacus schedule resource policies
tests:
  - name: Viewing an abacus schedule
    input:
      principals:
        - rob
        - ciara
        - max
        - gab
      resources:
        - contributor_only_schedule
      actions:
        - view
    expected:
      - principal: rob
        resource: contributor_only_schedule
        actions:
          view: EFFECT_DENY
      - principal: ciara
        resource: contributor_only_schedule
        actions:
          view: EFFECT_ALLOW
      - principal: max
        resource: contributor_only_schedule
        actions:
          view: EFFECT_ALLOW
      - principal: gab
        resource: contributor_only_schedule
        actions:
          view: EFFECT_ALLOW
