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.
Uh oh!
There was an error while loading. Please reload this page.
-
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 (
t1andt2). Each tenant has one user (t1hasu1,t2hasu2) and one file (f1andf2respectively). By default access to a file is granted through themembersrelationship 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 foru2who 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=100This correctly returns
u1andu2.Full JSON response
JSON Response of the REST API
{ "type": "union", "children": [ { "type": "leaf", "tuple": { "namespace": "", "object": "", "relation": "", "subject_id": "u2" } }, { "type": "union", "children": [ { "type": "leaf", "tuple": { "namespace": "", "object": "", "relation": "", "subject_id": "u1" } } ], "tuple": { "namespace": "", "object": "", "relation": "", "subject_set": { "namespace": "Tenant", "object": "t1", "relation": "members" } } } ], "tuple": { "namespace": "", "object": "", "relation": "", "subject_set": { "namespace": "File", "object": "f1", "relation": "owners" } } }Afterward I tried querying the "reverse" (meaning to get all the files
u2has access to) with the following request:http://localhost:4466/relation-tuples?namespace=File&relation=owners&subject_id=u2&max-depth=100But this only returned
f1.Full JSON response
JSON Response of the REST API
{ "relation_tuples": [ { "namespace": "File", "object": "f1", "relation": "owners", "subject_id": "u2" } ], "next_page_token": "" }For me this seems like Keto is only resolving the explicitly added relation between
u2andf1, but does not consider the "implicity" ownership off2through themembersrelation ofu2andt2. 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