与其他用户共享Google App脚本-请求权限&授权脚本 [英] Share a Google App Script to other users - permission requested & authorize script

查看:88
本文介绍了与其他用户共享Google App脚本-请求权限&授权脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个电子表格,该电子表格后面带有一些GAS,可以打开一个包含一些输入的表单,现在我需要部署Webapp并将其共享给其他一些用户.问题在于,当其他用户尝试打开电子表格(在Google云端硬盘中共享)时,他们会收到以下错误消息:

I've created a spreadsheet with some GAS behind it that opens a form with some inputs, and now I need to deploy the webapp and share it to some other users. The problem is that when the other users try to open the spreadsheet (shared in Google Drive), they get this error message:

我已经尝试过:

  1. 与用户共享电子表格(添加具有权限可以编辑的用户电子邮件地址)
  2. 使用以下设置部署Webapp设置:
  1. Share the spreadsheet to the user/s (Adding the user/s email address with permission Can edit)
  2. Deploy the webapp settings with the following settings:

如您所见,设置屏幕报告"您需要在分发URL之前授权脚本".

As you can see, the setting screen reports "You need to authorize the script before distributing the URL".

如何授权脚本?我找不到办法.您知道是否还有另一种共享方式并让其他用户运行脚本吗?

How can I authorize the script? I can't find a way to do that. Do you know if there's another way to share and let other users run the script?

推荐答案

问题是您正在将Web应用程序与工作表上的ui对话框混合.
该Web应用程序是从该Web应用程序URL访问的(发布Web应用程序时已给出).
ui对话框是显示在电子表格顶部的窗口.
您要使用webapp,请按照该教程进行操作.如果所有用户都在同一个gapps域中,则将其发布以从域中访问.否则使用公共匿名.
在发布之前运行doGet进行授权.也可以执行其他ui-on-sheet,但是您需要为每个用户授权更多的步骤.

The problem is you are mixing web app with ui dialog on a sheet.
The webapp is accesed from the webapp url (given when you publish the webapp).
The ui dialog is a window shown on top of the spreadsheet.
You want to use webapp, follow the tutorial for that. Publish it to be accesed from the domain if all users are in the same gapps domain. Else use public anonymous.
Run doGet before publish to authorize. Its also possible to do the other ui-on-sheet but you need more steps for each user to authorize.

这篇关于与其他用户共享Google App脚本-请求权限&授权脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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