Hi all, I wonder is there any way to
# spicedb
f
Hi all, I wonder is there any way to enforce some relation quantity constraints. For example, A
document:id
resource is defined to allow only one relation
reviewer
with subject
user:id
, If second reviewer is assigned, either simply throws error or overrides the former one.
v
Hi 👋 you can use
WriteRelationships
with a
Precondition
. For example you can send a request that specifies "no other relationship like this should exist" using operation
OPERATION_MUST_NOT_MATCH
. Please have a look at https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.Precondition
4 Views