All Products
Search
Document Center

Container Service for Kubernetes:DescribeUserPermission

Last Updated:Nov 07, 2024

In an Container Service for Kubernetes (ACK) cluster, you can create and specify different Resource Access Management (RAM) users or roles to have different access permissions. This ensures access control and resource isolation. You can call the DescribeUserPermission operation to query the permissions that are granted to a RAM user or RAM role on ACK clusters, including the resources that are allowed to access, the scope of the permissions, the predefined role, and the permission source.

Operation description

Precautions:

  • If you call this operation as a Resource Access Management (RAM) user or by assuming a RAM role, only the permissions granted on the clusters on which the current account has the role-based access control (RBAC) administrator permissions are returned. If you want to query the permissions on all clusters, you must use an account that has the RBAC administrator permissions on all clusters.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cs:GetUserPermissionsget
  • All Resources
    *
    none
none

Request syntax

GET /permissions/users/{uid} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
uidstringYes

The ID of the RAM user or RAM role.

Note If you want to grant permissions to a RAM role, enter the ID of the RAM role.
21175****

Response parameters

ParameterTypeDescriptionExample
array<object>

The response body.

permissionobject
resource_idstring

The authorization setting. Valid values:

  • {cluster_id} is returned if the permissions are scoped to a cluster.
  • {cluster_id}/{namespace} is returned if the permissions are scoped to a namespace of a cluster.
  • all-clusters is returned if the permissions are scoped to all clusters.
c1b542****
resource_typestring

The authorization type. Valid values:

  • cluster: indicates that the permissions are scoped to a cluster.
  • namespace: indicates that the permissions are scoped to a namespace of a cluster.
  • console: indicates that the permissions are scoped to all clusters. This value was displayed only in the console.
cluster
role_namestring

The name of the custom role. If a custom role is assigned, the value is the name of the assigned custom role.

view
role_typestring

The type of predefined role. Valid values:

  • admin: administrator
  • ops: O&M engineer
  • dev: developer
  • restricted: restricted user
  • custom: custom role
admin
is_ownerlong

Indicates whether the permissions are granted to the cluster owner.

  • 0: indicates that the permissions are not granted to the cluster owner.
  • 1: indicates that the permissions are granted to the cluster owner. The cluster owner is the administrator.
1
is_ram_rolelong

Indicates whether the permissions are granted to the RAM role. Valid values:

  • 0: indicates that the permissions are not granted to the RAM role.
  • 1: indicates that the permissions are granted to the RAM role.
1

The parent_id parameter is deprecated. Do not use this parameter.

Examples

Sample success responses

JSONformat

[
  {
    "resource_id": "c1b542****",
    "resource_type": "cluster",
    "role_name": "view",
    "role_type": "admin",
    "is_owner": 1,
    "is_ram_role": 1
  }
]

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history