Method: users.getCapabilities
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://drivelabels.googleapis.com/v2beta/{name=users/*/capabilities}
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
必需。用户的资源名称。仅支持“users/me/capabilities”。
|
查询参数
参数 |
customer |
string
此请求的客户范围。例如:“customers/abcd1234”。如果未设置,则会返回当前客户中的设置。
|
响应正文
用户的功能。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"name": string,
"canAccessLabelManager": boolean,
"canAdministrateLabels": boolean,
"canCreateSharedLabels": boolean,
"canCreateAdminLabels": boolean
} |
字段 |
name |
string
仅限输出。用户功能的资源名称。
|
canAccessLabelManager |
boolean
仅限输出。用户是否有权访问标签管理器。
|
canAdministrateLabels |
boolean
仅限输出。用户是否为共享标签功能的管理员。
|
canCreateSharedLabels |
boolean
仅限输出。是否允许用户创建新的共享标签。
|
canCreateAdminLabels |
boolean
仅限输出。是否允许用户创建新的管理员标签。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.labels.readonly
https://www.googleapis.com/auth/drive.admin.labels
https://www.googleapis.com/auth/drive.admin.labels.readonly
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Method: users.getCapabilities\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.UserCapabilities.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGets the user capabilities.\n\n### HTTP request\n\n`GET https://drivelabels.googleapis.com/v2beta/{name=users/*/capabilities}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|----------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The resource name of the user. Only \"users/me/capabilities\" is supported. |\n\n### Query parameters\n\n| Parameters ||\n|------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customer` | `string` The customer to scope this request to. For example: \"customers/abcd1234\". If unset, will return settings within the current customer. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe capabilities of a user.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"canAccessLabelManager\": boolean, \"canAdministrateLabels\": boolean, \"canCreateSharedLabels\": boolean, \"canCreateAdminLabels\": boolean } ``` |\n\n| Fields ||\n|-------------------------|--------------------------------------------------------------------------------------------|\n| `name` | `string` Output only. Resource name for the user capabilities. |\n| `canAccessLabelManager` | `boolean` Output only. Whether the user is allowed access to the label manager. |\n| `canAdministrateLabels` | `boolean` Output only. Whether the user is an administrator for the shared labels feature. |\n| `canCreateSharedLabels` | `boolean` Output only. Whether the user is allowed to create new shared labels. |\n| `canCreateAdminLabels` | `boolean` Output only. Whether the user is allowed to create new admin labels. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive.labels`\n- `\n https://www.googleapis.com/auth/drive.labels.readonly`\n- `\n https://www.googleapis.com/auth/drive.admin.labels`\n- `\n https://www.googleapis.com/auth/drive.admin.labels.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]