All Products
Search
Document Center

Container Service for Kubernetes:UpdateUserPermissions

Last Updated:Nov 07, 2024

Updates the role-based access control (RBAC) permissions of a Resource Access Management (RAM) user or RAM role. By default, you do not have the RBAC permissions on a Container Service for Kubernetes (ACK) cluster if you are not the cluster owner or you are not using an Alibaba Cloud account. You can call this operation to specify the resources that can be accessed, permission scope, and predefined roles. This helps you better manage the access control on resources in ACK clusters.

Operation description

Precautions:

  • You can update the permissions of a RAM user or RAM role on a cluster by using full update or incremental update. If you use full update, the existing permissions of the RAM user or RAM role on the cluster are overwritten. You must specify all the permissions that you want to grant to the RAM user or RAM role in the request parameters when you call the operation. If you use incremental update, you can grant permissions to or revoke permissions from the RAM user or RAM role on the cluster. In this case, only the permissions that you specify in the request parameters when you call the operation are granted or revoked, other permissions of the RAM user or RAM role on the cluster are not affected.

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:UpdateUserPermissionsnone
  • All Resources
    *
    none
none

Request syntax

POST /permissions/users/{uid}/update HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
uidstringNo

The ID of the RAM user or RAM role whose permissions you want to update.

2367****
bodyarray<object>No

The request body.

objectNo
clusterstringNo

The ID of the cluster on which you want to grant permissions to the RAM role or RAM role.

  • Set this parameter to an empty string if role_type is set to all-clusters.
c796c60***
is_custombooleanNo

Specifies whether to assign a custom role to the RAM user or RAM role. If you want to assign a custom role to the RAM user or RAM role, set role_name to the name of the custom role.

false
role_namestringNo

The predefined role. Valid values:

  • admin: administrator
  • ops: O&M engineer
  • dev: developer
  • restricted: restricted user
  • Custom role
ops
role_typestringNo

The authorization type. Valid values:

  • cluster: authorizes the RAM user or RAM role to manage the specified clusters.
  • namespace: authorizes the RAM user or RAM role to manage the specified namepsaces.
  • all-clusters: authorizes the RAM user or RAM role to manage all clusters.
cluster
namespacestringNo

The namespace that you want to authorize the RAM user or RAM role to manage. This parameter is required only if you set role_type to namespace.

test
is_ram_rolebooleanNo

Specifies whether to use a RAM role to grant permissions.

false
modestringNo

The authorization method. Valid values:

  • apply: updates all permissions of the RAM user or RAM role. If you use this method, the existing permissions of the RAM user or RAM role on the cluster are overwritten. You must specify all the permissions that you want to grant to the RAM user or RAM role in the request parameters when you call the operation.
  • delete: revokes the specified permissions from the RAM user or RAM role. If you use this method, only the permissions that you specify are revoked, other permissions of the RAM user or RAM role on the cluster are not affected.
  • patch: grants the specified permissions to the RAM user or role. If you use this method, only the permissions that you specify are granted, other permissions of the RAM user or RAM role on the cluster are not affected.

Default value: apply

apply

Response parameters

ParameterTypeDescriptionExample
The current API has no return parameters

Examples

Sample success responses

JSONformat

{}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history