By default, a RAM user or RAM role has no RBAC permissions in a cluster they did not create, unless granted permissions at the all-clusters scope. Call the GrantPermissions operation to update the RBAC permissions for a RAM user or RAM role. This operation lets you configure accessible resources, permission scopes, and predefined roles to manage cluster access control.
Operation description
-
If you call this operation as a RAM user, you must have permission to modify the cluster permissions of other RAM users or RAM roles. Otherwise, the API call fails and returns the
StatusForbiddenorForbiddenGrantPermissionserror code. For more information, see Authorize a RAM user to manage the RBAC permissions of other RAM users. -
This operation overwrites all existing cluster permissions for the specified RAM user or RAM role. Your request must include the complete set of permissions you want to grant.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:GrantPermission |
update |
*All Resource
|
None | None |
Request syntax
POST /permissions/users/{uid} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| uid |
string |
Yes |
The ID of the RAM user or RAM role. |
2367**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
array<object> |
No |
The request body parameters. |
|
|
object |
No |
The authorization details. |
||
| cluster |
string |
Yes |
The ID of the target cluster.
|
c796c60*** |
| is_custom |
boolean |
No |
Set to true if |
false |
| role_name |
string |
Yes |
The name of the role to grant. Valid values:
Important
Valid values:
|
ops |
| role_type |
string |
Yes |
The authorization scope. Valid values:
|
cluster |
| namespace |
string |
No |
The name of the namespace. This parameter is required only when |
test |
| is_ram_role |
boolean |
No |
Set to true if you are granting permissions to a RAM role. |
false |
Response elements
|
Element |
Type |
Description |
Example |
None defined.
Examples
Success response
JSON format
{}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.