google-drive-api - 无法更新或删除共享云端硬盘项目的继承权限
问题描述
用例: * 创建了一个共享驱动器“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 返回“无法更新或删除共享驱动器项目的继承权限。”>
解决方案
无法对共享驱动器中的文件进行这种精细的权限更新。您只能使用fileId
字段中的 ID 更新整个 Shared Drive 文件夹的权限。
提交功能请求
随时在此处请求此新功能:https ://issuetracker.google.com/issues/new?component=191650&template=824106
推荐阅读
- c# - Vlookup 多条件 C#
- plc - DN4800/MELDAS 500 CNC 机床 ATC 问题
- php - 下一个包含失败
- python - 在 python 中使用 For 循环使其语法正确
- redux - reduxForm - FieldsArray:fields.push({}) 不工作
- php - 使用 echo 创建 amp-html 代码时无法找到 PHP 语法错误
- flash - 如何将一些脚本添加到现有的 swf 文件中?
- angular - 如何切换到从一个组件?
- python - Flask 未更新网页以反映 application.py 中的更改
- python - 我可以添加 ArgumentParser 来解析子命令吗?