Hey folks. Wondering if there's any way to define ...
# spicedb
s
Hey folks. Wondering if there's any way to define a permission based on a relationship being empty? I have a schema like the following, that requires a user have all the same tags assigned to a document before they will be allowed to view:
Copy code
definition user {}

  definition tag {
    relation user: user
    permission allow = user
  }

  definition document {
      relation tag: tag
      permission view = tag.all(allow)
  }
Is there any way to modify it so that the logic would be "either the user has all the tags assigned to the document OR the document has no tags"? i.e., a version of the following that actuallly parses:
Copy code
definition document {
      relation tag: tag
      permission view = tag.all(allow) | !tag
  }