Query Role Permission Set

Last Updated on : 2023-07-06 09:13:28download

Query a set of permissions based on the list of role codes.

API address

GET: /v1.0/iot-02/roles-permissions

Request parameter

Parameter nameTypeINRequiredDescription
requestRolePermissionQueryRequestquerytrueThe request of querying role permissions.

Description of request

Parameter nameTypeINRequiredDescription
role_codesString trueThe list of role IDs, separated with commas (,).

Return parameter

Parameter nameTypeDescription
resultListThe returned result of the relationship between roles and permissions.

Description of result

Parameter nameTypeDescription
role_codeStringThe identifier of a specified role.
permissionsListThe list of permissions.

Description of permissions

Parameter nameTypeDescription
permission_codeStringThe identifier of a permission.
permission_nameStringThe name of a specified permission.
permission_typeIntegerThe type of permission. Valid values:
  • 1: API
  • 2: menu
  • 3: button
  • 4: data
  • 5: combination
parent_codeStringThe identifier of a parent permission.
orderIntegerThe order that the items are displayed.
remarkStringThe remarks.

Request example

GET: /v1.0/iot-02/roles-permissions?role_codes=roleCodegcnI, roleCodegdkj

Return example

{
    "tid": "51a630e5948811ec82481264f1be8bd1",
    "result": [
        {
            "role_code": "roleCodegcnI",
            "permissions": [
                {
                    "remark": "Remarks about modifications",
                    "permission_code": "permissionCodepHhD",
                    "permission_name": "namepermissionCodepHhD",
                    "permission_type": 4,
                    "order": 3
                }
            ]
        }
    ],
    "t": 1645607374866,
    "success": true
}

Error code

For more information, see error code.