github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/internal/services/integrationtesting/testconfigs/multipleops.yaml (about) 1 --- 2 schema: >- 3 definition user {} 4 5 definition resource { 6 relation first: user 7 relation second: user 8 relation third: user 9 relation banned: user 10 relation must_be_here: user 11 relation also_must_be_here: user 12 permission computed = (first + second + (third - banned)) & must_be_here & also_must_be_here 13 permission computed2 = must_be_here & also_must_be_here & ((third - banned) + first + second) 14 permission computed3 = (must_be_here & also_must_be_here) & ((third - banned) + first + second) 15 } 16 relationships: | 17 // tom is present via `first` 18 resource:r0#first@user:tom 19 resource:r0#must_be_here@user:tom 20 resource:r0#also_must_be_here@user:tom 21 22 // sarah is present via `first` but is missing from `must_be_here` 23 resource:r0#first@user:sarah 24 resource:r0#also_must_be_here@user:sarah 25 26 // amy is present via `third` and not banned. 27 resource:r0#third@user:amy 28 resource:r0#must_be_here@user:amy 29 resource:r0#also_must_be_here@user:amy 30 31 // fred is present via `third` but is banned. 32 resource:r0#third@user:fred 33 resource:r0#must_be_here@user:fred 34 resource:r0#banned@user:fred 35 resource:r0#also_must_be_here@user:fred 36 37 // jane is present via `second` 38 resource:r0#second@user:jane 39 resource:r0#must_be_here@user:jane 40 resource:r0#also_must_be_here@user:jane 41 assertions: 42 assertTrue: 43 - "resource:r0#computed@user:tom" 44 - "resource:r0#computed@user:amy" 45 - "resource:r0#computed@user:jane" 46 - "resource:r0#computed2@user:tom" 47 - "resource:r0#computed2@user:amy" 48 - "resource:r0#computed2@user:jane" 49 - "resource:r0#computed3@user:tom" 50 - "resource:r0#computed3@user:amy" 51 - "resource:r0#computed3@user:jane" 52 assertFalse: 53 - "resource:r0#computed@user:sarah" 54 - "resource:r0#computed@user:fred" 55 - "resource:r0#computed2@user:sarah" 56 - "resource:r0#computed2@user:fred" 57 - "resource:r0#computed3@user:sarah" 58 - "resource:r0#computed3@user:fred"