go
cr, err := client.Permission.LookupSubject(context.Background(), &v1.PermissionLookupSubjectRequest{
TenantId: "t1",
Metadata: &v1.PermissionLookupSubjectRequestMetadata{
SnapToken: "",
SchemaVersion: "",
Depth: 20,
},
Entity: &v1.Entity{
Type: "document",
Id: "1",
},
Permission: "edit",
SubjectReference: &v1.RelationReference{
Type: "user",
Relation: "",
},
PageSize: 20,
ContinuousToken: "",
})client.permission.lookupSubject({
tenantId: "t1",
metadata: {
snapToken: "",
schemaVersion: "",
depth: 20,
},
entity: {
type: "document",
id: "1",
},
permission: "edit",
subject_reference: {
type: "user",
relation: ""
},
page_size: 10,
continuous_token: ""
}).then((response) => {
console.log(response.subject_ids)
})curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/lookup-subject' \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata":{
"snap_token": "",
"schema_version": "",
"depth": 20,
},
"entity": {
"type": "document",
"id": "1"
},
"permission": "edit",
"subject_reference": {
"type": "user",
"relation": ""
},
page_size: 20,
continuous_token: ""
}'{
"subject_ids": [
"<string>"
],
"continuous_token": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Permission Service
Subject Filtering
POST
/
v1
/
tenants
/
{tenant_id}
/
permissions
/
lookup-subject
go
cr, err := client.Permission.LookupSubject(context.Background(), &v1.PermissionLookupSubjectRequest{
TenantId: "t1",
Metadata: &v1.PermissionLookupSubjectRequestMetadata{
SnapToken: "",
SchemaVersion: "",
Depth: 20,
},
Entity: &v1.Entity{
Type: "document",
Id: "1",
},
Permission: "edit",
SubjectReference: &v1.RelationReference{
Type: "user",
Relation: "",
},
PageSize: 20,
ContinuousToken: "",
})client.permission.lookupSubject({
tenantId: "t1",
metadata: {
snapToken: "",
schemaVersion: "",
depth: 20,
},
entity: {
type: "document",
id: "1",
},
permission: "edit",
subject_reference: {
type: "user",
relation: ""
},
page_size: 10,
continuous_token: ""
}).then((response) => {
console.log(response.subject_ids)
})curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/lookup-subject' \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata":{
"snap_token": "",
"schema_version": "",
"depth": 20,
},
"entity": {
"type": "document",
"id": "1"
},
"permission": "edit",
"subject_reference": {
"type": "user",
"relation": ""
},
page_size: 20,
continuous_token: ""
}'{
"subject_ids": [
"<string>"
],
"continuous_token": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Lookup Subject endpoint lets you ask questions in form of “Which subjects can do action Y on entity:X?”. As a response of this you’ll get a subject results in a format of string array.
In this endpoint you’ll get directly the IDs’ of the subjects that are authorized in an array.
Path Parameters
Body
application/json
PermissionLookupSubjectRequest is the request message for the LookupSubject method in the Permission service.
Response
A successful response.
PermissionLookupSubjectResponse is the response message for the LookupSubject method in the Permission service.