The "cloneRole" action clones an existing role along with all its assigned privileges. It assigns a new name to the new role and optionally assigns new metadata.
Request examples
Minimal
{
"action": "cloneRole",
"params":
{
"sourceRoleName": "role1",
"cloneRoleName": "role1Cloned",
"clonePrivileges": true,
"cloneDescription": "",
"cloneMetadata": {}
}
"authToken": "",
"requestId": ""
}
Response examples
Minimal
{
"authToken": "",
"requestId": "",
"errorCode": 0,
"errorMessage": ""
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
cloneDescription |
The "cloneDescription" property defines the "roleDescription" of the clone role. |
Optional with default of ""
|
string | 0 to 65,500 bytes |
cloneMetadata |
The "cloneMetadata" property defines the "metadata" property of the clone role. The "metadata" property contains user-defined properties that add keywords and tags about the role. The server indexes this field with a full-text index so you can search for any word or phrase to find code packages. |
Optional with default of {}
|
object | 0 or more key/value pairs |
clonePrivileges |
The "clonePrivileges" property causes the newly created clone role to retain the privileges of the source role when true. |
Optional with default of false
|
Boolean |
|
cloneRoleName |
The "cloneRoleName" property defines the "roleName" property of the clone role. |
Required - No default value | string | 1 to 30 bytes |
sourceRoleName |
The "sourceRoleName" property specifies the name of the role that will be used as a template to create the clone role. |
Required - No default value | string | 1 to 30 bytes |