go
cr, err := client.Permission.SubjectPermission(context.Background(), &v1.PermissionSubjectPermissionRequest{
TenantId: "t1",
Metadata: &v1.PermissionSubjectPermissionRequestMetadata{
SnapToken: "",
SchemaVersion: "",
OnlyPermission: false,
Depth: 20,
},
Entity: &v1.Entity{
Type: "repository",
Id: "1",
},
Subject: &v1.Subject{
Type: "user",
Id: "1",
},
})client.permission.subjectPermission({
tenantId: "t1",
metadata: {
snapToken: "",
schemaVersion: "",
onlyPermission: true,
depth: 20
},
entity: {
type: "repository",
id: "1"
},
subject: {
type: "user",
id: "1"
}
}).then((response) => {
console.log(response);
})curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/subject-permission' \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata":{
"snap_token": "",
"schema_version": "",
"only_permission": true,
"depth": 20
},
"entity": {
"type": "repository",
"id": "1"
},
"subject": {
"type": "user",
"id": "1",
"relation": ""
}
}'{
"results": {}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Permission Service
Subject Permission List
POST
/
v1
/
tenants
/
{tenant_id}
/
permissions
/
subject-permission
go
cr, err := client.Permission.SubjectPermission(context.Background(), &v1.PermissionSubjectPermissionRequest{
TenantId: "t1",
Metadata: &v1.PermissionSubjectPermissionRequestMetadata{
SnapToken: "",
SchemaVersion: "",
OnlyPermission: false,
Depth: 20,
},
Entity: &v1.Entity{
Type: "repository",
Id: "1",
},
Subject: &v1.Subject{
Type: "user",
Id: "1",
},
})client.permission.subjectPermission({
tenantId: "t1",
metadata: {
snapToken: "",
schemaVersion: "",
onlyPermission: true,
depth: 20
},
entity: {
type: "repository",
id: "1"
},
subject: {
type: "user",
id: "1"
}
}).then((response) => {
console.log(response);
})curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/subject-permission' \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata":{
"snap_token": "",
"schema_version": "",
"only_permission": true,
"depth": 20
},
"entity": {
"type": "repository",
"id": "1"
},
"subject": {
"type": "user",
"id": "1",
"relation": ""
}
}'{
"results": {}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}The Subject Permission List endpoint allows you to inquire in the form of “Which permissions user:x can perform on entity:y?”. In response, you’ll receive a list of permissions specific to the user for the given entity, returned in the format of a map.
In this endpoint, you’ll receive a map of permissions and their statuses directly. The structure is map[string]CheckResult, such as “sample-permission” -> “ALLOWED”. This represents the permissions and their associated states in a key-value pair format.
Path Parameters
Body
application/json
PermissionSubjectPermissionRequest is the request message for the SubjectPermission method in the Permission service.