首页 > 解决方案 > 无法更新或删除共享云端硬盘项目的继承权限

问题描述

用例: * 创建了一个共享驱动器“Demo_Folder” * 对于“用户 A” - 授予内容管理员访问权限。对于“用户 B”- 授予查看者访问权限。* 将 3 个文件(file1.sv、file2.csv 和 file3.csv)上传到 Demo_Folder * 对于 file3.csv,我想为“用户 B”提供编辑器访问权限。我能够通过 UI 做到这一点。但是,我无法使用 API 做到这一点。

这是代码:

权限 = {u'role':u'writer'} service.permissions().update(fileId=file_id,supportsAllDrives=True,permissionId=permission_id, body=permission).execute()

错误: googleapiclient.errors.HttpError:https://www.googleapis.com/drive/v3/files/<****************>/permissions/<********> ?alt=json&supportsAllDrives=true 返回“无法更新或删除共享驱动器项目的继承权限。”>

标签: google-drive-apigoogle-apis-explorergoogle-drive-shared-drive

解决方案


无法对共享驱动器中的文件进行这种精细的权限更新。您只能使用fileId字段中的 ID 更新整个 Shared Drive 文件夹的权限。

提交功能请求

随时在此处请求此新功能:https ://issuetracker.google.com/issues/new?component=191650&template=824106


推荐阅读