Update Role Permission¶
Assign or remove menu groups, permissions, or visible organization structures associated with an application to/from a role.
Prerequisites¶
The application has been granted the permission “Edit all roles in the OU”. Contact the OU administrator to get the permission if necessary.
Request Format¶
POST https://{apigw-address}/app-portal-service/v2.3/role/app/resource/assign
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Required |
String |
OU ID. How to get orgId >> |
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
roleId |
Required |
String |
Role ID. |
appId |
Required |
String |
The access key of the application. How to get Access Key >> |
resourceType |
Required |
Integer |
The type of permission. The following values are supported:
|
operationType |
Required |
Integer |
The type of operation. The following values are supported:
|
resourceIds |
Required |
Array |
Menu group ID, visible organization structure ID, or permission ID list. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
boolean |
Whether the role permissions are updated successfully. |
Error Codes¶
Error Code |
Description |
---|---|
31400 |
Possible reasons are:
|
31403 |
Possible reasons are:
|
31404 |
OU has no permission to access the application. |
Samples¶
Request Sample¶
url: https://{apigw-address}/app-portal-service/v2.3/role/app/resource/assign
method: POST
{
"roleId": "your_role_id",
"appId": "your_access_key",
"resourceType": 0,
"operationType": 1,
"resourceIds": ["your_resource_id"]
}
Return Sample¶
{
"code": 0,
"message": "OK",
"data": true
}