POST
/
v1
/
tenants
/
{tenant_id}
/
permissions
/
subject-permission
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",
    },
})
{
  "results": {}
}

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

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

PermissionSubjectPermissionRequestMetadata metadata for the PermissionSubjectPermissionRequest.

entity
object

Entity represents an entity with a type and an identifier.

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
results
object

Map of results for each permission check.