Query Sub-Permissions

Last Updated on : 2023-10-09 08:09:18download

Based on the permission ID, query the list of sub-permissions that are linked with the specified permission.

API address

GET: /v2.0/cloud/iam/permission/{permission_id}/item

Request parameter

Parameter nameTypeINRequiredDescription
permission_idLonguritrueThe ID of the specified permission.
last_row_keyLongqueryfalseThe starting ID of the query.
page_sizeIntegerqueryfalseThe number of items returned on each page.

Return parameter

Parameter nameTypeDescription
successBooleanIndicates whether the operation is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
error_codeStringThe error code. For more information, see the error codes.
error_msgStringThe message that is returned if the request fails. It is empty if the request is successful.
resultQueryResourceAndPolicyListByPermissionResThe returned result.

Description of result

Parameter nameTypeDescription
permission_idLongThe ID of the specified permission.
permission_item_listListThe list of sub-permissions.
last_row_keyLongThe starting ID of the query.
page_sizeIntegerThe number of items returned on each page.

Description of permission_item_list

Parameter nameTypeDescription
item_idLongThe ID of the specified sub-permission.
policy_idLongThe ID of the specified policy.
policy_nameStringThe name of the specified policy.
resource_idStringThe ID of the specified resource.
resource_typeIntegerThe type of the specified resource. Valid values:
  • 1: space resource.
  • 2: device resource.
  • 11: global resource type.
item_typeIntegerThe type of the specified sub-permission. Valid values:
  • 1: The space contains subgroups.
  • 0: The space does not contain subgroups.

Request example

GET: /v2.0/cloud/iam/permission/1/item?lastRowKey=0&pageSize=100

Return example

{
    "tid": "195bceee56b411ee801ef25dabf95fef",
    "result": {
        "last_row_key": 181044,
        "permission_item_list": [
            {
                "policy_id": 110001,
                "item_id": 232371810,
                "item_type": 0,
                "resource_type": 11,
                "resource_id": "*"
            }
        ],
        "permission_id": 181044,
        "page_size": 10
    },
    "t": 1695104201504,
    "success": true
}

Error code

For more information, see error code.