响应中未填充权限资源的值属性 [英] value attribute for Permissions Resource not populated in responses

查看:13
本文介绍了响应中未填充权限资源的值属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看着:

https://developers.google.com/drive/v2/reference/权限#resource

API 不返回包含 ACL 的电子邮件地址值的 values 属性.目前尚不清楚为什么不返回该值,我认为这是一个隐私问题,但这意味着 Drive SDK 不支持文档迁移(从一个 Google 帐户到另一个)旧文档列表 API v3 可以的用例:

the values attribute which contains the email address value for the ACL is not returned by the API. It's not clear why the value isn't returned, I assume it's a privacy issue but it means Drive SDK can't support document migration (from one Google account to another) use cases where the old Documents List API v3 can:

https://developers.google.com/google-apps/documents-list/#retrieving_the_acl_for_a_document_file_or_collection

现在,我正在考虑为我的项目添加 Drive API 和 Docs v3 API 范围,并且只使用 Docs API 调用来检索 ACL,但理想情况下我可以只使用 Drive API 调用.我错过了什么吗?是否可以向 Drive API 添加一个允许 ACL 电子邮件地址检索的特殊范围,或者是否有其他方法来处理这个问题?

for now I'm looking at adding both Drive API and Docs v3 API scopes for my project and just using the Docs API call to retrieve the ACLs but ideally I'd be able to use just Drive API calls. Am I missing anything? Could a special scope be added to Drive API that allows ACL email address retrieval or is there some other way to handle this?

推荐答案

自发布此问题以来,Drive API 已更新为允许在 permissions.insert()(id 属性).这允许迁移 ACL,而无需知道电子邮件地址(只需将 permissionIds 直接复制到新文件中).

Since this question was posted, Drive API has been updated to allow permissionId to be sent on permissions.insert() (the id attribute). This allows for migration of ACLs without ever needing to know the email addresses (just straight copy the permissionIds over to the new file).

另外:

  • the permissions.getIdForEmail() API call provides a quick way to get the ID for a given email address

在为具有 permissions.get() 或权限的文件返回权限时.insert(),包含 domain 属性,它应该有助于确定 ACL 是否引发安全问题.

when returning permissions for a file with permissions.get() or permissions.insert(), the domain attribute is included which should help determine if the ACL raises security concerns.

我相信这些功能涵盖了需要实际 ACL 电子邮件地址检索的大多数用例.

I believe these features cover most use cases where the actual ACL email address retrieval was needed.

这篇关于响应中未填充权限资源的值属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆