https://authzed.com logo
#spicedb
Title
# spicedb
t

Tomek

06/10/2022, 8:14 AM
Hey guys, lately I've been working with SpiceDB. Must say I'm reaching out to you because I'm a bit stuck with performing relationship removal in Spice. To give you more context, lets assume there is a following relationship tuple in the database:
Copy code
namespace     |              object_id               |  relation   | userset_namespace |      userset_object_id
--------------+--------------------------------------+-------------+-------------------+--------------------------
    aminal    |               1234                   |   owner     |      user         |              4321
--------------+--------------------------------------+-------------+-------------------+--------------------------
    aminal    |               1234                   |   owner     |      user         |              8765
Let's say I want to remove all relationships where animal's resource
id
is
1234
. My request via REST to SpiceDB looks like this.
Copy code
wget -qO- --post-data '{"relationshipFilter":{"resourceType": "animal", "optionalResourceId":"1234" }}' --header="Authorization: Bearer []" http://localhost:8443/v1/relationship/delete
From what I expected from this request, is that it removes all records from the db table snippet I introduced you. Unfortunately nothing happened and the records are still present. Could you help me out and try to figure out what is wrong with my understanding of relationship removal?