Determine external user permissions
This document is automatically generated based on https://github.com/authing/authing-docs-factory based on https://api-explorer.genauth.ai V3 API, and is consistent with API parameters and return results. If the description of this document is incorrect, please refer to the V3 API.
Description
When your user is an external user and you need to determine whether he has a certain permission for a resource, you can use this interface to pass the user's ID through externalId
Method name
ManagementClient.checkExternalUserPermission
Request parameters
| Name | Type | Is it required | Default value | Description | Sample value |
|---|---|---|---|---|---|
| resources | string[] | yes | - | Resource path list, Tree resources need to go to specific tree nodes | ["strResourceCode","arrResourceCode","treeResourceCode/StructCode1/resourceStructChildrenCode1"] |
| action | string | yes | - | Data resource permission operation, read, get, write and other actions | get |
| externalId | string | yes | - | External user ID | 63721xxxxxxxxxxxxdde14a3 |
| namespaceCode | string | yes | - | Permission space Code | examplePermissionNamespace |
| judgeConditionEnabled | boolean | no | - | Whether to enable conditional judgment, default is true | true |
| authEnvParams | <a AuthEnvParams | no | - | Conditional environment attribute, if conditional judgment is enabled, use | {"ip":"127.0.0.1"} |
Request response
Type: CheckExternalUserPermissionRespDto
| Name | Type | Description |
|---|---|---|
| statusCode | number | Business status code, which can be used to determine whether the operation is successful. 200 means success. |
| message | string | description information |
| apiCode | number | Segment error code, which can be used to get the specific error type (successful request does not return). For a detailed list of error codes, please see: API Code List |
| data | <a CheckExternalUserPermissionDataDto | Response data |
Sample result:
json
{
"statusCode": 200,
"message": "Operation successful",
"apiCode": 20001,
"data": {
"checkResultList": {
"namespaceCode": "examplePermissionNamespace",
"action": "get",
"resource": "treeResource1",
"enabled": true
}
}
}Data Structure
AuthEnvParams
| Name | Type | Is it required? | Description | Example value |
|---|---|---|---|---|
| ip | string | No | ip | 127.0.0.1 |
| city | string | No | city | Beijing |
| province | string | No | province | Hubei |
| country | string | No | country | China |
| deviceType | string | No | Device type: PC/Mobile | PC |
| systemType | string | No | Operation type: Windows, Android, iOS, MacOS | Windows |
| browserType | string | No | Browser type: IE/Chrome/Firefox | IE |
| requestDate | string | No | Request time | 2022-07-03T03:20:30.000Z |
CheckExternalUserPermissionDataDto
| Name | Type | Is it required | Description | Sample value |
|---|---|---|---|---|
| checkResultList | array | Yes | Check result list Nested type: <a CheckExternalUserPermissionsRespDto。 |
CheckExternalUserPermissionsRespDto
| Name | Type | Is it required? | Description | Example value |
|---|---|---|---|---|
| namespaceCode | string | Yes | Permission space Code | examplePermissionNamespace |
| action | string | Yes | Data resource permission operation | get |
| resource | string | Yes | Resource path | treeResource1 |
| enabled | boolean | Yes | Whether the user has a certain operation of the data resource under a certain permission space | true |