Replies: 2 comments 2 replies
-
I have the same question. I think possible solution for this scenario to make dfs\bfs approach. User:Piter => Group:Admin => Resource:my-git-repo Now i can make only expand for Resource:my-git-repo, and i receive full graph But for reverse scenario i can make several calls like: listRelationTuples
return Group:Admin listRelationTuples
return In parallel, receiving answers, we build a reverse tree User:Piter The main issue with this decision is performance. |
Beta Was this translation helpful? Give feedback.
-
I checked OpenFGA and i see the same problem https://openfga.dev/docs/getting-started/perform-list-objects
|
Beta Was this translation helpful? Give feedback.
-
Hi, I'm very new to Keto and currently trying to implement the a simple permission model to learn the basic concepts. But I'm struggling with fetching all objects a specific subject is related to. Here's the example I've implemented.
The permission model:
The relations:
In other words: There are two tenants (
t1
andt2
). Each tenant has one user (t1
hasu1
,t2
hasu2
) and one file (f1
andf2
respectively). By default access to a file is granted through themembers
relationship of the tenant, so the tenant acts similar to a directory. But access to files can also be shared across tenants by specifying these relationships explicitly (this is done foru2
who has access tof1
).By issuing the following request to the Expand API, I first tried to query all owners of the file
f1
:http://localhost:4466/relation-tuples/expand?namespace=File&object=f1&relation=owners&max-depth=100
This correctly returns
u1
andu2
.Full JSON response
JSON Response of the REST API
Afterward I tried querying the "reverse" (meaning to get all the files
u2
has access to) with the following request:http://localhost:4466/relation-tuples?namespace=File&relation=owners&subject_id=u2&max-depth=100
But this only returned
f1
.Full JSON response
JSON Response of the REST API
For me this seems like Keto is only resolving the explicitly added relation between
u2
andf1
, but does not consider the "implicity" ownership off2
through themembers
relation ofu2
andt2
. Is this a limitation of Keto or have I made a mistake in modeling the permissions?PS: The second request mentioned above uses the List API. The documentation to this API states:
Therefore I also tried using the Expand API for the "reverse" lookup, but didn't get back any useful results.
Beta Was this translation helpful? Give feedback.
All reactions