permify icon indicating copy to clipboard operation
permify copied to clipboard

Add Scope of EntityIds to lookup-entity API Filter

Open ucatbas opened this issue 1 year ago • 1 comments

Describe alternatives you've considered This is an enhancement request to the lookup-entity API. Currently, the filter operation runs on all entities by default. It would be beneficial to introduce a new feature that allows users to specify a scope of entity-ids for the filter operation.

Additional context Details:

  • Add a new parameter, scope, which will accept an array of entity-ids.
  • The filter will only apply to the entities within this specified scope, improving query efficiency and precision.
  • If the scope parameter is not provided, the filter will behave as it currently does, running on all entities.

ucatbas avatar Aug 27 '24 10:08 ucatbas

Here is an example request body:

{
    "metadata": {
        "snap_token": {{snap_token}},
        "schema_version": {{schema_version}},
        "depth": 100
    },
    "scope": ["id_1", "id_2", "id_3"],
    "entity_type": "repository",
    "permission": "view",
    "subject": {
        "type": "user",
        "id": "user_1",
        "relation": ""
    },
    "page_size": {{page_size}},
    "continuous_token": {{continuous_token}}
}

ucatbas avatar Aug 27 '24 10:08 ucatbas