bland-finland-95044
02/29/2024, 3:58 PMchilly-king-10285
02/29/2024, 3:58 PMchilly-king-10285
02/29/2024, 3:58 PMbland-finland-95044
02/29/2024, 6:06 PMbland-finland-95044
02/29/2024, 6:07 PMchilly-king-10285
02/29/2024, 6:07 PMchilly-king-10285
02/29/2024, 6:07 PMsubject_id
using Ory, you can utilize the GET /relation-tuples
endpoint. This endpoint allows you to retrieve all relationships that match a given query. While the subject_id
is not a required field for this query, specifying it will filter the results to only include relationships involving the specified subject_id
. Here's how you can structure your query: http GET /relation-tuples?subject_id=YOUR_SUBJECT_ID
Replace YOUR_SUBJECT_ID
with the actual subject_id
you're interested in querying. ### Parameters - subject_id (query parameter): The subject_id
of the Relationship you're interested in. ### Example Assuming you want to query all relations for a subject_id
of 12345
, your HTTP request would look like this: http GET /relation-tuples?subject_id=12345
This request will return all relation tuples where the subject_id
is 12345
. ### Response The response will be a JSON object containing the paginated list of relation tuples that match your query. Each relation tuple will include details such as the namespace
, object
, relation
, and subject_id
or subject_set
. json { "next_page_token": "next-page-token-value", "relation_tuples": [ { "namespace": "example-namespace", "object": "example-object", "relation": "example-relation", "subject_id": "12345" }, ... ] }
Please note, the actual endpoint, parameters, and response structure might vary based on the specific version of Ory you are using and any custom configurations. The provided example is based on the standard API reference for querying relationships in Ory. For more detailed information and advanced query capabilities, refer to the [Ory documentation on querying relationships](https://www.ory.sh/docs/reference/api#ory-apis---relationship). Unfortunately, the exact URL to directly access this documentation was not provided in the extracts, so you might need to navigate the Ory documentation site or consult the API reference section relevant to your Ory version for more details.bland-finland-95044
02/29/2024, 8:20 PMchilly-king-10285
02/29/2024, 8:20 PMchilly-king-10285
02/29/2024, 8:20 PMsubject_id
, including the relations that are directly defined on it as well as those relations' relations recursively, you can use the Ory Permissions API to perform an expand operation. This operation allows you to recursively resolve and expand permissions based on the relationships defined in Ory. However, based on the provided extracts, there isn't a direct example or explicit endpoint detailed for recursively listing all permissions for a subject_id
including indirect relations. The closest relevant operation mentioned is the expandPermissions
method, which could theoretically be used to achieve a recursive expansion of permissions if it supports specifying a subject_id
and recursively expanding its relations. ### Hypothetical Approach If we were to construct a hypothetical approach based on the concept of expanding permissions and the information available, it might involve using an endpoint similar to the following: http POST /relation-tuples/expand
With a request body structured to specify the subject_id
and potentially a max-depth
parameter to control the recursion depth: json { "namespace": "your_namespace", "object": "your_object", "relation": "your_relation", "subject_id": "your_subject_id", "max_depth": 10 }
This request would theoretically return all direct and indirect permissions associated with the specified subject_id
, up to the specified recursion depth. ### Actual Documentation and API Reference Since the exact method and endpoint to achieve this recursive listing of permissions for a subject_id
are not detailed in the provided extracts, it's recommended to consult the [Ory Keto documentation](https://www.ory.sh/docs/keto/) and the [API reference](https://www.ory.sh/docs/reference/api) for more accurate and detailed information on how to perform such operations. The Ory Keto API and its documentation would be the best resources for understanding how to query and manipulate permissions, relationships, and their recursive expansions within the Ory ecosystem.