Getting permissions per user with custom roles #311
-
Hey folks, If we use the tuples given in the example: Using this information
can I get a response like this?
or just
To give more background to the use case: In the application admin users can create roles and assign those to other users, so I would like to show those users which permissions they have on certain objects. If this is not possible (or not practical) in OpenFGA I would have to store this information outside of it, which of course is possible, but feels wrong knowing OpenFGA has the necessary information. What I've tried so far was the /stores/{store_id}/read, which gives me all the necessary (and much more) information and requires some additional logic as I have to translate the roles to permissions. I was not able to restrict the query to just one user - instead I got information about all users and roles of a specific object. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @ossibaer, there's nothing that achieves exactly what you're looking for unfortunately. If you know the relations for the object type you're checking against you could use the ListRelations API within the SDKs that takes that list of relations and then performs a check for each one then returns the subset that are true for that user. |
Beta Was this translation helpful? Give feedback.
Hey @ossibaer, there's nothing that achieves exactly what you're looking for unfortunately. If you know the relations for the object type you're checking against you could use the ListRelations API within the SDKs that takes that list of relations and then performs a check for each one then returns the subset that are true for that user.