https://authzed.com logo
#spicedb
Title
# spicedb
j

Joey

02/13/2022, 7:16 AM
one option: write the user to each associated relation, and then write a relation linking the
viewer_state
to the associated relation in the same document, based on its state:
Copy code
definition user {}

definition document {
  relation acquired_viewer: user
  relation validated_viewer: user
  relation processed_viewer: user

  relation viewer_state: document#acquired_viewer | document#validated_viewer | document#processed_viewer
 
  permission view = viewer_state
}