👋 Hello folks, at $work, we're using
# spicedb
p
👋 Hello folks, at $work, we're using spicedb already for permissions and would like to introduce a feature that will mean folder and transitive permissions for documents inside folders. We're wondering if there's a way to implement a move folder atomically... Initially, I though we could use a:
Copy code
WriteRelationships(
  list(
    WR(doc1:parent#oldparent, operation.delete),
    WR(doc1:parent#newparent, operation.create)
  ),
  preconditions(folder had old parent before)
)
~But it seems that operations are at the WriteRelationships level, not at each relationshipupdate... so this seems like a no go. Any idea?~ ~I wouldn't like to have partial states committed to the db in this case.~ EDIT: Turns out I read the API wrong, operation is part of each relationship update and I can do exactly what I was expecting. Sorry for the noise!
wait a minute, I think I can specify different operations in each relationshipupdate!
Yes, I can, lemme update the comment!
j
correct
4 Views