Query Permission Data

Last Updated on : 2023-10-09 08:06:21download

Based on the user ID, query the permission data linked with the specified user.

API address

GET: /v2.0/cloud/iam/permission/user/{user_id}

Request parameter

Parameter nameTypeINRequiredDescription
user_idStringuritrueThe user ID.
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.
resultQueryPermissionListByUserResThe returned result.

Description of result

Parameter nameTypeDescription
user_idStringThe user ID.
permission_listListThe list of authorized permissions.
last_row_keyLongThe starting ID of the query.
page_sizeIntegerThe number of items returned on each page.

Description of permission_list

Parameter nameTypeDescription
permission_idLongThe ID of the specified permission.
nameStringThe name of the specified permission.
descriptionStringThe description of the specified permission.
typeIntegerThe authorization type. Valid values:
  • 0: generic authorization.
  • 1: temporary authorization.
start_timeLongThe time when a temporary authorization takes effect. This field is only valid for temporary authorization.
end_timeLongThe time when a temporary authorization expires. This field is only valid for temporary authorization.
gmt_createLongThe creation time.

Request example

GET: /v2.0/cloud/iam/permission/user/uid1?lastRowKey=0&pageSize=100

Return example

{
    "tid": "195bceee56b411ee801ef25dabf95fef",
    "result": {
        "last_row_key": 181044,
        "user_id": "uid1",
        "permission_list": [
            {
                "gmt_create": 1695104201,
                "description": "Description",
                "permission_id": 232371810,
                "type": "0",
                "name": "Permission name"
            }
        ],
        "page_size": 10
    },
    "t": 1695104201504,
    "success": true
}

Error code

For more information, see error code.