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",
    },
})

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

    if err == io.EOF {
        break
    }

    // res.EntityId
}
{
  "result": {
    "entity_id": "<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
metadata
object

PermissionLookupEntityRequestMetadata metadata for the PermissionLookupEntityRequest.

entity_type
string

Type of the entity to lookup, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes.

permission
string

Name of the permission to check, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes.

subject
object

Subject represents an entity subject with a type, an identifier, and a relation.

context
object

Context encapsulates the information related to a single operation, including the tuples involved and the associated attributes.

Response

200 - application/json
result
object

PermissionLookupEntityStreamResponse is the response message for the LookupEntityStream method in the Permission service.

error
object