Check Role Permissions

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

Check whether a role has the specified permissions. The role ID and permission ID are required.

API address

POST: /v1.0/iot-02/roles/{role_code}/actions/permission-valid

Request parameter

Parameter nameTypeINRequiredDescription
role_codeStringuritrueThe identifier of a specified role.

Description of body

Parameter nameTypeINRequiredDescription
permission_codeString trueThe identifier of a permission.

Return parameter

Parameter nameTypeDescription
resultBooleanIndicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.

Request example

POST: /v1.0/iot-02/roles/123/actions/permission-valid
{
  "permission_code": "permissionCodeXyYG"
}

Return example

{
    "tid": "524bc6be948811ec82481264f1be8bd1",
    "result": true,
    "t": 1645607375967,
    "success": true
}

Error code

For more information, see error code.