Update Role Permission


Assign or remove menu groups, operational permissions, or visible organization structures to/from a role.

Request Format


POST https://{apigw-address}/app-portal-service/v2.3/role/app/resource/assign

Request Parameters (Query)


Name

Mandatory/Optional

Data Type

Description

orgId

Mandatory

String

OU ID.

Request Parameters (Body)


Name

Mandatory/Optional

Data Type

Description

roleId

Mandatory

String

Role ID.

appId

Mandatory

String

Application ID.

resourceType

Mandatory

Integer

Type of permission. 0 for menu groups, 1 for operational permissions, and 2 for visible organization structures.

operationType

Mandatory

Integer

Type of operation. 0 for assigning permissions, and 1 for removing permissions.

resourceIds

Mandatory

List/String

Menu group ID, visible organization structure ID, or operational permission ID list.

Response Parameter


Name

Data Type

Description

data

boolean

the results of assigning or removing permissions, true for success and false for failure.

Error Codes


Error Code

Description

31400

Possible reasons are: - OU ID, role ID and application ID are required. - Permission type is missing or invalid. - operation type is missing or invalid. - The ID of menu group, operational permission, or visible organization structure is missing or invalid.

31403

Possible reasons are: - Service account has no permission to edit roles. - Role, menu group, operational permission, or visible organization structure does not exist.

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_app_id",
    "resourceType": 0,
    "operationType": 1,
    "resourceIds": ["your_resource_id"]
}

Return Sample


{
  "code": 0,
  "message": "OK",
  "data": true
}