github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/internal/services/integrationtesting/testconfigs/publiccaveatexclusion.yaml (about)

     1  ---
     2  schema: |+
     3    definition user {}
     4  
     5    caveat some_caveat(somecondition int) {
     6      somecondition == 42
     7    }
     8  
     9    definition document {
    10    	relation viewer: user
    11      relation banned: user:* with some_caveat | user
    12      permission view = viewer - banned
    13    }
    14  
    15  relationships: >-
    16    document:firstdoc#viewer@user:tom
    17  
    18    document:firstdoc#viewer@user:fred
    19  
    20    document:firstdoc#banned@user:*[some_caveat]
    21  
    22    document:firstdoc#banned@user:tom
    23  
    24  assertions:
    25    assertTrue:
    26      - 'document:firstdoc#view@user:fred with {"somecondition": 41}'
    27    assertCaveated:
    28      - "document:firstdoc#view@user:fred"
    29    assertFalse:
    30      - "document:firstdoc#view@user:tom"
    31      - 'document:firstdoc#view@user:fred with {"somecondition": 42}'
    32      - 'document:firstdoc#view@user:tom with {"somecondition": 41}'