How do I check a permission using the API? #1527
Replies: 1 comment
-
Hello @jonlambert No worries at all, it's a great question! In Ory Keto, permissions are modeled as relationships between entities. The When you want to check a permission using the Keto API, you're essentially checking if a certain relationship exists. For example, to check if a user has the The API endpoint you mentioned, Here's how you might use it to check the
You would make a separate API request for each relationship you want to check. If any of the requests return true, then the user has the For more details on how to use the API, you can refer to the Keto API Reference. I hope this helps! Let me know if you have any other questions. |
Beta Was this translation helpful? Give feedback.
-
Hey!
I'm evaluating using Keto at the moment for use in our team.
I understand we can define relationships between entities (Document, Folder, User) and there appears to be a section in the docs that refers to permissions, and how to define them in OPL using the
permits
attribute.However, it's not clear at all how I query this using the API.
Taking this example from the docs:
How do I query the
view
permission? The documentation directs me to the API, which has an endpoint which allows me to "Check a permission", but there doesn't seem to be anything relating to permissions in the arguments to the endpoint:Am I missing something super obvious? Apologies if so!
Beta Was this translation helpful? Give feedback.
All reactions