如何为管理员不拥有的文档传输文件所有权? [英] How to transfer File Ownership for a Document which admin doesn't own?

查看:73
本文介绍了如何为管理员不拥有的文档传输文件所有权?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用案例




  • 作为管理员服务帐户,使用Google文档API传输文档所有权,类似于内置的cPanel高级工具 - >文件所有权转让


限制

通过使用管理员帐户模拟用户,您尝试执行的操作是可能的。该文档显示了如何在此处执行此操作。



本质上,首先请求将 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屋!

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