无需打开脚本编辑器,Google应用脚本首次运行时会在电子表格上授予用户权限访问服务 [英] Google apps script grant user permissions access services on spreadsheet in ther first run without open script editor

查看:228
本文介绍了无需打开脚本编辑器,Google应用脚本首次运行时会在电子表格上授予用户权限访问服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧...我有一个问题,不是我必须说的是来自客户端的请求。

像大家知道,如果脚本访问任何服务,那么您必须在第一次运行该功能时授予他们权限。我的意思是点击授予按钮。



事情是我通过SpreadSheet上的自定义菜单运行脚本的项目,它们不会打开脚本编辑器即可。第一次运行脚本需要点击diablog来授予权限。所以如果这是第一次用户(不是我)通过SpreadSheet菜单运行脚本,那么SpreadSheet将显示消息正在运行脚本...任何东西。



因此,如果有任何方法可以授予用户权限访问服务以打开脚本编辑器(我不希望他们查看我的源和我的好,他们)然后告诉我的你的家伙。
很多感谢!



P / S:抱歉我的英文不好。

方案

如果新用户第一次尝试运行任何函数时只使用默认apis(no o-auth),他将被提示授予对这些服务的访问权限。
如果你想让它更加明显,你可以在你的自定义菜单中添加一个名为'Authorize'的菜单项,它将执行以下操作:-)除了触发进程或最终显示欢迎消息之外什么都没有。
在这一步之后,将不再有授权请求。


Well... I have a problem, no I must say that is a request from the client.

Like everyone know that if the script access any service, then you must grant them the permission on the first time run the function. I mean click to the "grant" button.

The thing is the project I do user run script via custom menu on SpreadSheet, they will not open script editor. The first time run script will need to click to diablog to grant permissions. So if it is the first time user (not me) run the script via SpreadSheet menu then SpreadSheet will show the message "Running script..." any nothing more.

So if there are any way to grant user permissions access services with out to open script editor (I don't want them view my source for my good and them to ) then tell my your guys. Many Thank!

P/S: And sorry for my poor English.

解决方案

If you use only default apis (no o-auth) the first time a new user will try to run any of the function he will be prompted to grant access to these services. If you want to make it more obvious you can add a menu item called 'Authorize' in your custom menu that would do what it says :-) I.e nothing except trigger the process or eventually show a welcome message... After that step there will be no more authorization request.

这篇关于无需打开脚本编辑器,Google应用脚本首次运行时会在电子表格上授予用户权限访问服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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