Method: permissions.delete
删除权限。
警告:不支持对同一文件执行并发权限操作;系统只会应用最近一次的更新。
HTTP 请求
DELETE https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}
网址采用 gRPC 转码语法。
路径参数
参数 |
fileId |
string
文件或共享云端硬盘的 ID。
|
permissionId |
string
权限的 ID。
|
查询参数
参数 |
supportsAllDrives |
boolean
请求访问权限的应用是否同时支持“我的云端硬盘”和共享云端硬盘。
|
supportsTeamDrives (deprecated) |
boolean
已弃用:请改用 supportsAllDrives 。
|
useDomainAdminAccess |
boolean
以网域管理员身份发出请求;如果设置为 true,则当文件 ID 参数引用共享云端硬盘且请求者是共享云端硬盘所属网域的管理员时,系统会向请求者授予访问权限。
|
enforceExpansiveAccess |
boolean
请求是否应强制执行广泛的访问权限规则。
|
响应正文
如果成功,响应正文将为空的 JSON 对象。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
某些镜重受限,您的应用需要接受安全评估才能使用它们。如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-18。
[null,null,["最后更新时间 (UTC):2025-02-18。"],[[["This document outlines the process for deleting a permission for a file or shared drive using the Google Drive API."],["The request requires specifying the `fileId` and `permissionId` as path parameters and can optionally include query parameters like `supportsAllDrives` and `useDomainAdminAccess`."],["The request body should be empty, and upon successful deletion, the response body will also be empty."],["Authorization is required using one of the specified OAuth scopes, which might require security assessment for restricted ones."],["Concurrent permission operations are not recommended as only the last update will be applied."]]],["This document outlines the process for deleting a permission associated with a file or shared drive. The core action is a `DELETE` HTTP request to a specified URL, including `fileId` and `permissionId` as path parameters. The request body must be empty. Optional query parameters, like `supportsAllDrives` and `useDomainAdminAccess`, modify the request's behavior. Successful deletion yields an empty JSON response. It is noted that concurrent operations on the same file are unsupported. The document list the needed Authorization scopes.\n"]]