Google Apps脚本 - 以另一个用户身份运行脚本(使用密码) [英] Google Apps Script - Run script as a another user (with password)

查看:144
本文介绍了Google Apps脚本 - 以另一个用户身份运行脚本(使用密码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将文件所有权转移给另一个用户的脚本,这在运行脚本的用户是要转移的文件的所有者时起作用。

I have a script which transfers the ownership of a file to another user, this works when the user who runs the scripts is the owner of the file that is going to be transferred.

setOwner(emailAddress)

是否有可能在不需要以文件所有者身份登录来运行脚本的情况下完成此操作?我有电子邮件和所有者的密码。

Would it be possible to accomplish this without having to login as the owner of the file to run the script? I have the email and the password of the owner.

推荐答案

不那么简单,您必须使用oauth2访问并使用Drive API 更新权限

Not as straightforward, you'll have to get access with oauth2 and use the Drive API to update the permissions.

从未使用过oauth2 / Drive API,因此无法提供任何示例。

Never worked with oauth2/Drive API so can't give you any examples.

这篇关于Google Apps脚本 - 以另一个用户身份运行脚本(使用密码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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