https://authzed.com logo
Title
h

highserpent

09/14/2022, 5:30 AM
Hey everyone, I have a use-case where I want to get all the relations a subject-Id has with an object-Id since I see in the lookup API we have an api to get all the object-Ids a subject-Id has with a specific relation, is there any way to get the above scenario as well, other than creating my relations as objects, since that creates some other issues. To be more precise in my use case: For my application where I have multiple roles and multiple features and each role has a different access on a feature, which in turns can give me a result that a user with a specific role has access over a feature. features := []string{"f1","f2"} roles := []string{"r1","r2"} features /roles r1. r2 f1. {"view","delete"} {"delete","edit"} f2. {"view"} {"delete"} features_role_rights_array := [][][]string{{{"view","delete"},{"delete","edit"}},{{"view"},{"delete"}}} Now Say a user with id user-1 has a role r2, I want to see over a feature what access does he has? Is there any way to get this information? I have tried this kind of configuration: These are Google Zanzibar Representations: features:f1#view@(roles:r1#member) features:f1#delete@(roles:r1#member) features:f1#delete@(roles:r2#member) features:f1#edit@(roles:r2#member) features:f2#view@(roles:r1#member) features:f2#delete@(roles:r2#member) roles:r2#member@user-1 Now in order to get my query I am not able to get the details of accesses user-1 has. Is there any way to get this information? Please let me know if you need any more details around this.
v

vroldanbet

09/14/2022, 7:57 AM
hey @highserpent 👋🏻 Have you considered the expand API? It gives you a description of how a subject was granted a given permission over a resource.