Hi, is it possible to get all relations of a parti...
# spicedb
u
Hi, is it possible to get all relations of a particular kind. Say I want to delete a certain schema definition, then i need to clear all relevant relatios first, which makes sense! But can I ask SpiceDB to get all relevant relations without knowing all ressources involved beforehand. Its a kind of expected relation but only on type ? I later solved it by making a more open deleteresponse only consisting of ressourcetype, subjecttype and relation, which then removed all relevant relations 🙂
v
👋🏻hi, if what you are looking for is for help deleting all relationships of a relation that is to be deleted in a
WriteSchema
operation,
DeleteRelationships
has some fields that help you with that. So you can tell it "delete all relationships of this relation", for example. https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.PermissionsService.DeleteRelationships note the
relationship_filter
field in
DeleteRelationships
https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.RelationshipFilter
u
Hi thx, just figured it out, sometimes it helps just to formulate the problem to others 😉
v
you are most welcome to drop by and formulate your thoughts 😄
10 Views