如何为管理员不拥有的文档传输文件所有权? [英] How to transfer File Ownership for a Document which admin doesn't own?
问题描述
使用案例
- 作为管理员服务帐户,使用Google文档API传输文档所有权,类似于内置的cPanel高级工具 - >文件所有权转让
限制
-
API正在Google Apps管理服务帐户的上下文中调用,而不是最终用户帐户,因为API是从站点页面中的Google Apps脚本调用的。
-
授权是OAuth 1.0,因为这是Apps脚本支持的功能
p> - 将admin服务帐户自己的文件的所有权转交给其他用户的帐户,如 here
- 转让其他用户文件的所有权,理想情况下不需要共享任何pe管理员服务帐户的调整;如果没有其他的方式,他们可以通过管理服务帐户与文件共享编辑权限。
-
目前这返回一个
ServiceException - 您没有权限共享这些项目:
>解决方案
需要什么:
通过使用管理员帐户模拟用户,您尝试执行的操作是可能的。该文档显示了如何在此处执行此操作。
本质上,首先请求将 default
替换为当前所有者的电子邮件地址的API URL。虽然请求必须以管理员用户的身份进行授权。
https://docs.google.com/feeds/ user@yourdomain.com/private/full/
一旦请求了该网址,所有供稿网址将会该电子邮件已返回。然后,只需像通常那样更改所有权。
Use Case
- As admin service account, transfer Document Ownership using the Google Docs API, similar to the built in cPanel "Advanced Tools" -> "Document ownership transfer"
Constraints
APIs are being invoked in context of a Google Apps admin service account rather than the end-user account since APIs are being invoked from Google Apps Script in Sites page
Authorization is OAuth 1.0 since this is what Apps Script supports
What works:
- Transferring ownership of the admin service account's own files to another user's account as documented here
What is required:
- Transfer ownership of another user's files, ideally without them sharing any permissions with the admin service account; if there's no other way of doing it, they could share edit permissions on the file with the admin service account.
Currently this returns a
" ServiceException - You do not have permission to share these item(s):"
What you're trying to do is possible by impersonating the user using the admin account. The documentation shows how to do this here.
Essentially, start by requesting the API URL with default
replaced with the current owner's email address. The request must be made while authorized as the admin user, though.
https://docs.google.com/feeds/user@yourdomain.com/private/full/
Once that URL is requested, all feed URLs will be returned with that email already present. Then, simply change ownership as you would normally.
这篇关于如何为管理员不拥有的文档传输文件所有权?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!