All Products
Search
Document Center

Container Service for Kubernetes:GrantUserPermission

Last Updated:Sep 16, 2025

Grants role-based access control (RBAC) permissions to Resource Access Management (RAM) users or RAM roles. System policies can be attached to RAM users to grant only the operation permissions on Distributed Cloud Container Platform for Kubernetes (ACK One) cluster resources. The operation permissions include creating and viewing instances. If you want to perform operations on Kubernetes resources in a specific cluster by using a RAM user or assuming a RAM role, such as creating GitOps applications and Argo workflows, you must grant RBAC permissions to the RAM user or RAM role to perform operations on the specified ACK One cluster and namespace. This topic describes how to grant RBAC permissions to a RAM user or RAM role.

Operation description

  • To call this API operation to grant permissions to a RAM user or RAM role on a specific cluster, you must use an Alibaba Cloud account, the account that is used to create the cluster, or a RAM user that has the cluster administrator permissions. A regular RAM user does not have the permissions to call this operation.
  • Before you grant RBAC permissions to a RAM user or RAM role on a cluster, you must grant the operation permissions to the RAM user or RAM role on the specified cluster. For more information, see Attach a system permission policy to a RAM user or RAM role.

For more information, see Authorization overview.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
adcp:GrantUserPermissioncreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RoleTypestringYes

The authorization type. Valid values:

  • cluster: The permissions are granted to a cluster.
  • namespace: The permissions are granted to a namespace of a cluster.
cluster
RoleNamestringYes

The predefined role. Valid values:

  • admin: administrator
  • dev: developer
  • gitops-dev: GitOps developer. The parameter is available only for Fleet instances.

The value of RoleName and that of RoleType must meet the following requirements:

  • If RoleType is set to cluster, this parameter must be set to admin.
  • If RoleType is set to namespace, this parameter must be set to dev or gitops-dev.
admin
ClusterIdstringYes

The cluster ID.

c102fe5f1ee5d4c87a68121a77d8b****
NamespacestringNo

The name of the namespace.

  • If RoleType is set to cluster, you do not need to specify this parameter.
  • This parameter is required if RoleType is set to namespace.
  • If RoleType is set to namespace and RoleName is set to gitops-dev, this parameter is required and must be set to argocd.
default
UserIdstringYes

The ID of the RAM user or RAM role.

2176****
IsRamRolebooleanNo

The entity to which the permissions are granted. A value of true indicates that the permissions are granted to a RAM user. A value of false indicates that the permissions are granted to a RAM role.

false

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

2D676EFC-8C04-5CCE-A08E-BB97D24B47E8

Examples

Sample success responses

JSONformat

{
  "RequestId": "2D676EFC-8C04-5CCE-A08E-BB97D24B47E8"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2023-07-28The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-05-22The request parameters of the API has changedView Change Details