Replies: 1 comment 1 reply
-
I created the following code to determine which types are associated with the object to be deleted from the database. I found the relationships from the authorization model and placed them in the tuplekey list. Then I will send this tuplekey list to the openfga listusers api to create a listuser request for each type and relationship.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checklist
Describe the problem you'd like to have solved
When we delete an object from our database, we send a query with listobject to find all the relationships established by the type of that object one by one, then we create a delete query. This makes it difficult to collect, delete and maintain the garbage left in the openfga database when the object is deleted.
Describe the ideal solution
It would make it really easy if there was an api call like the one below, where the task of the api is to find out what relationships the type to be deleted has with other types and delete them.
fgaClient.deleteType(typeName, id);
Alternatives and current workarounds
Currently, the best way to know this is to determine which type the object to be deleted represents in the authorization schema, then determine which relationships that type has with which types, then send a listObjects query one by one, then try to find the opposite situations with listUsers.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions