POST
/
v1
/
tenants
/
{tenant_id}
/
permissions
/
lookup-entity-stream
str, err := client.Permission.LookupEntityStream(context.Background(), &v1.PermissionLookupEntityRequest{
    Metadata: &v1.PermissionLookupEntityRequestMetadata{
        SnapToken: "",
        SchemaVersion: "",
        Depth: 50,
    },
    EntityType: "document",
    Permission: "view",
    Subject: &v1.Subject{
        Type: "user",
        Id: "1",
    },
    PageSize: 20,
    ContinuousToken: "",
})

// handle stream response
for {
    res, err := str.Recv()

    if err == io.EOF {
        break
    }

    // res.EntityId
}
{
  "result": {
    "entity_id": "<string>",
    "continuous_token": "<string>"
  },
  "error": {
    "code": 123,
    "message": "<string>",
    "details": [
      {
        "@type": "<string>"
      }
    ]
  }
}

The difference between this endpoint from direct Lookup Entity is response of this entity gives the IDs’ as stream. This could be useful if you have large data set that getting all of the authorized data can take long with direct lookup entity endpoint.

Path Parameters

tenant_id
string
required

Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \“[a-zA-Z0-9-,]+\“, max 64 bytes.

Body

application/json

PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service.

Response

200
application/json
A successful response.(streaming responses)

The response is of type object.