If I wanted to model a boolean, would it be better...
# spicedb
t
If I wanted to model a boolean, would it be better to represent that with a wildcard or a caveat? My hunch is that caveats are slower, but wildcards are less flexible. Here's an example, where the boolean represents whether permissions should be inherited from the parent:
Copy code
definition user {}

definition folder {
    relation editor: user
    permission can_edit = editor
}

definition document {
    relation parent: folder
    relation should_inherit_permissions: user:* // wildcard here represents a boolean

    relation editor: user
    permission can_edit = editor + (should_inherit_permissions & parent->can_edit)
}
3 Views