> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET (/users/{requestorId}/permission/validate)

> GET (/users/{requestorId}/permission/validate)

# GET (/users/{requestorId}/permission/validate)

获取一个是/否答案,以确定该用户是否被允许对目标用户执行指定的操作。

* [URI 参数](#ID4EQ)
* [查询字符串参数](#ID4E2)
* [授权](#ID4EDC)
* [必需的请求标头](#ID4EID)
* [请求正文](#ID4ETE)
* [HTTP 状态代码](#ID4E5E)
* [必需的响应标头](#ID4ETG)
* [响应正文](#ID4EKAAC)

## URI 参数

| 参数 | 类型 | 说明 |
| - | - | - |
| requestorId | string | 必需。执行操作的用户的标识符。可能的值为 `xuid()` 和 `me`。此项必须为已登录的用户。示例值:`xuid(0987654321)`。 |

## 查询字符串参数

\| 参数 | 类型 | 说明 |
\| --- | --- | --- | --- | --- | --- |
\| setting | string 枚举 | 要检查的 PermissionId 值。示例值:"CommunicateUsingText"。 |
\| target | string | 将对其执行操作的用户的标识符。可能的值为 `xuid()`。示例值:`xuid(0987654321)` |

## 授权

使用的授权声明 | 声明 | 类型 | 是否必需? | 示例值 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Xuid | 64 位有符号整数 | 是 | 1234567890 |

## 必需的请求标头

\| 标头 | 类型 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Authorization | string | HTTP 身份验证的身份验证凭据。示例值:`XBL3.0 x=<userhash>;<token>` |
\| X-RequestedServiceVersion | string | 此请求应指向的 XBOX LIVE 服务的生成名称/编号。仅在验证标头的有效性、身份验证令牌中的声明等的有效性之后,请求才会路由到该服务。示例值:1。 |

## 请求正文

此请求正文中未发送任何对象。

## HTTP 状态代码

服务针对使用此方法对此资源发出的请求,返回本节中的一个状态代码。有关 XBOX Live 服务使用的标准 HTTP 状态代码的完整列表,请参阅[标准 HTTP 状态代码](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/httpstatuscodes)。

\| 代码 | 原因短语 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| 200 | OK | 已成功检索会话。 |
\| 400 | 请求无效。 | 示例:设置 ID 错误、URI 错误等。 |
\| 404 | URI 中指定的用户不存在。 | 找不到指定的资源。 |

## 必需的响应标头

\| 标头 | 类型 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Content-Type | string | 请求正文的 MIME 类型。示例值:`application/json` |
\| Content-Length | string | 响应中发送的字节数。示例值:34 |
\| Cache-Control | string | 服务器发出的用于指定缓存行为的礼貌请求。示例:`no-cache, no-store` |

## 响应正文

请参阅 [PermissionCheckResponse (JSON)](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-permissioncheckresponse)。

### 示例响应

```cpp theme={null}
{
    "isAllowed": false,
    "reasons":
    [
        {"reason": "BlockedByRequestor"},
        {"reason": "MissingPrivilege", "restrictedSetting": "VideoCommunications"}
    ]
}

```

## 另请参阅

##### 父主题

[/users/{requestorId}/permission/validate](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/privacy/uri-privacyusersrequestoridpermissionvalidate)

[PermissionId 枚举](https://devdocs.xbox.com/zh-CN/reference/live/rest/enums/privacy-enum-permissionid.md)


## Related topics

- [PermissionId Enumeration](https://devdocs.xbox.com/reference/live/rest/enums/privacy-enum-permissionid.md)
- [Enumeração PermissionId](https://devdocs.xbox.com/pt-BR/reference/live/rest/enums/privacy-enum-permissionid.md)
- [Enumeración PermissionId](https://devdocs.xbox.com/es/reference/live/rest/enums/privacy-enum-permissionid.md)
- [Énumération PermissionId](https://devdocs.xbox.com/fr/reference/live/rest/enums/privacy-enum-permissionid.md)
- [PermissionId 枚举](https://devdocs.xbox.com/zh-CN/reference/live/rest/enums/privacy-enum-permissionid.md)
