Skip to content

Get the structure list of external user authorized resources

This interface is mainly used to obtain the resource list authorized by external users, and obtain the authorization list of external user resources through the permission space Code, external user id, and resource Code.

Get user authorization string data resource example

  • Input parameter
json
{
  "namespaceCode": "examplePermissionNamespace",
  "externalId": "63721xxxxxxxxxxxxdde14a3",
  "resourceCode": "exampleStrResourceCode"
}
  • Output parameter
json
{
  "statusCode": 200,
  "message": "Operation successful",
  "apiCode": 20001,
  "data": {
    "namespaceCode": "exampleNamespaceCode",
    "resourceCode": "exampleStrResourceCode",
    "resourceType": "STRING",
    "strResourceAuthAction": {
      "value": "strTestValue",
      "actions": ["get", "delete"]
    }
  }
}

Get user authorization data array resource example

  • Input parameter
json
{
  "namespaceCode": "examplePermissionNamespace",
  "externalId": "63721xxxxxxxxxxxxdde14a3",
  "resourceCode": "exampleArrResourceCode"
}
  • Output parameters
json
{
  "statusCode": 200,
  "message": "Operation successful",
  "apiCode": 20001,
  "data": {
    "namespaceCode": "exampleNamespaceCode",
    "resourceCode": "exampleArrResourceCode",
    "resourceType": "ARRAY",
    "arrResourceAuthAction": {
      "values": ["arrTestValue1", "arrTestValue2", "arrTestValue3"],
      "actions": ["get", "delete"]
    }
  }
}

Example of obtaining user authorization tree data resources

  • Input parameters
json
{
"namespaceCode": "examplePermissionNamespace", "externalId": "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` - Outtake ```json { "statusCode": 200, "message": "Operation successful", "apiCode": 20001, "data":{ "namespaceCode": "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "TREE", "treeResourceAuthAction":{ "nodeAuthActionList":[{ "code": "tree11", "name": "tree11", "value": "test11Value", "actions": ["get","delete"], "children": [{ "code": "tree111", "name": "tree111", "value": "test111Value", "actions": ["update","read"]
}]
},{
"code": "tree22",
"name": "tree22",
"value": "test22Value",
"actions": ["get","delete"]
}]
}
}
}

Method name

ManagementClient.getExternalUserResourceStruct

Request parameters

Type: GetExternalUserResourceStructDto

NameTypeIs it requiredDefault valueDescriptionSample value
namespaceCodestringYes-Permission space CodeexamplePermissionNamespace
resourceCodestringYes-Resource CodeexampleResourceCode
externalIdstringYes-External user ID63721xxxxxxxxxxxxdde14a3

Request response

Type: GetExternalUserResourceStructRespDto

NameTypeDescription
statusCodenumberBusiness status code, which can be used to determine whether the operation is successful. 200 means success.
messagestringDescription
apiCodenumberSegmented error code, which can be used to get the specific error type.
requestIdstringRequest ID. It will be returned when the request fails.
data<a GetUserResourceStructDataDtoResponse data

Sample result:

json
{
  "statusCode": 200,
  "message": "Operation successful",
  "requestId": "934108e5-9fbf-4d24-8da1-c330328abd6c",
  "data": {
    "namespaceCode": "namespaceCode",
    "resourceCode": "resourceCode",
    "permissionBo": {
      "resourceId": "resourceId",
      "resourceType": "TREE",
      "nodeAuthActionList": {
        "code": "123",
        "value": "Sample resource policy node",
        "name": "Data resource",
        "action": "read",
        "children": "[{\"code\":\"code1\",\"name\":\"Subnode 1\",\"value\":\"Subnode value\",\"enabled\":false,\"action\":\"Create\",\"children\":[{\"code\":\"code2\",\"name\":\"Subnode 2\",\"value\":\"Subnode 2 value\",\"enabled\":true,\"action\":\"Get\"}]}]"
      }
    }
  }
}

Data structure

GetExternalUserResourceStructDataDto

NameTypeIs it required?DescriptionSample value
namespaceCodestringYesPermission space codenamespaceCode
resourceCodestringYesResource coderesourceCode
resourceTypestringYesData resource type, nested type, <a ResourceType. Currently supports three types: tree structure (TREE), string (STRING), array (ARRAY), and returns different structures according to different types.
- STRING: string type result StrResourceAuthAction.
- ARRAY: array type ArrResourceAuthAction.
- TREE: tree type TreeResourceAuthAction.
strResourceAuthActionStrResourceAuthActionNoString resource authorization structure, nested type: <a StrResourceAuthAction.
arrResourceAuthActionArrResourceAuthActionNoArray resource authorization structure, nested type: <a ArrResourceAuthAction.
treeResourceAuthActionTreeResourceAuthActionNoTree resource authorization structure, nested type: <a TreeResourceAuthAction. Tree resource authorization

ResourceType

NameTypeDescription
STRINGenumString type
ARRAYenumArray type
TREEenumTree type

StrResourceAuthAction

NameTypeIs it required?DescriptionSample value
valuestringYesValue of a string data resourceresourceValue
actionsarrayYesList of permission operations for a string data resource["read","get"]

ArrResourceAuthAction

NameTypeIs it required?DescriptionSample value
valuesarrayYesArray data resource's Values["resourceValue1","resourceValue2"]
actionsarrayYesArray data resource's permission operation list["read","get"]

TreeResourceAuthAction

NameTypeIs it required?DescriptionSample value
nodeAuthActionListarrayYesTree structure node list, nested type: <a TreeStructs.-

TreeStructs

NameTypeIs it requiredDescriptionSample value
codestringyesTree resource node Code, unique in the same level123
namestringyesTree resource node name, unique in the same levelData Resource
valuestringnoTree resource node ValueSample Resource Policy Node
actionsarrayyesPermission operation list of tree data resource policy noderead
childrenTreeStructsnoChild node data, child node data has a maximum of five levels, nesting type: <a TreeStructs.[{"code":"code1","name":"child node 1","value":"child node value","enabled":false,"action":"create","children":[{"code":"code2","name":"child node 2","value":"child node 2 value","enabled":true,"action":"get"}]}]

Agent infrastructure for identity, memory, and web action.