Get User Permissions

Get the permissions that are assigned to a user for the current application.

Operation Permissions

User login to Application Portal is not required.

Request Format

GET https://{apigw-address}/app-portal-service/v2.2/user/permissions

Request Parameters (URI)

Name

Mandatory/Optional

Data Type

Description

orgId

Mandatory

String

The organization ID.

userId

Mandatory

String

The user ID.

locale

Optional

String

The language code. If unspecified, it is set to English by default.

  • en_US for English

  • zh_CN for Chinese

  • es_ES for Spanish

  • ja_JP for Japanese

Response Parameters

Name

Data Type

Description

data

Data Struct

The list of permissions.

Data Struct

Name

Data Type

Description

permissions

PermissionDTO Struct List

The list of permissions.

PermissionDTO Struct

Name

Data Type

Description

id

String

The permission ID.

name

String

The permission name.

Error Codes

Code

Description

31404

The user or organization does not exist.

Samples

Request Sample

url: https://{apigw-address}/app-portal-service/v2.2/user/permissions?orgId={your_org_id}&userId={your_user_id}

method: GET

Return Sample

{
    "code":0,
    "data":{
        "permissions":[
          {
            "id":"002ef785-e4a5-4d43-8717-9ce2c0ea8930",
            "name":"name133"
          },
          {
            "id":"112ef785-e4a5-4243-8717-9cerc0ea8921",
            "name":"name134"
          }
        ]
    },
    "message":""
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void getUserPermissionsTest() {
        UserPermissionsRequest request=new UserPermissionsRequest("orgId", "userId");
        UserPermissionsResponse response=Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                .url("https://{apigw-address}").getResponse(request,UserPermissionsResponse.class);
        assertNotNull("response data should not be null", response.data);
    }
}