澄清活动用户范围和脚本授权 [英] Clarification on Active User Scope and Script Authorization

查看:84
本文介绍了澄清活动用户范围和脚本授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含UI应用程序脚本的电子表格。该应用程序从电子表格中读取/更新。

I have a spreadsheet with a UI app script. The app reads/updates from the spreadsheet.

我目前的设置是:以我的身份执行应用程序。

My current settings are: Execute the app as "me".

谁有权访问该应用程序: 任何人。

Who has access to the app: "anyone".

我基本上是通过电子邮件发送工作流。这些电子邮件可以在域外,但都是Gmail地址。

I'm essentially sending out workflows that have assignments by email. Those emails can be outside of the domain but would all be gmail addresses.

我希望能够根据需要访问Session.getActiveUser()根据用户访问UiApp在应用上允许某些功能。除非我以脚本所有者身份登录,否则该函数似乎不提供任何信息。从不同地址访问时,Session.getActiveUser()是空的。

I had hoped I'd be able to access the Session.getActiveUser() as I need to allow certain functionality on the app based on user accessing the UiApp. That function does not seem to provide any info unless I'm logged in as the script owner. Session.getActiveUser() is blank when accessing from a different address.

有没有办法让活动用户不必执行应用程序,因为用户访问应用程序。我不想与所有最终用户共享电子表格。

Is there a way to get the active user without having to Execute the app as "User accessing the app". I'd rather not have to share the spreadsheet with all the end users.

感谢您的任何建议。

Thanks for any suggestions.

推荐答案

为了提高可读性而重写评论:

在这种情况下共享电子表格并不意味着任何人只要电子表格的网址仍然未知,就可以直接以电子表格的形式打开电子表格。如果您将应用部署为访问Web应用的用户,那么该应用确实需要访问该应用,但除非您发布,否则任何人都无法找到该表单的网址。我经常使用这个配置,但当然我不知道你的确切用例...... ;-)在我的情况下,应用程序本身决定了一个特定的用户可以做什么或不做什么(通过启用/禁用某些功能/面板,具体取决于登录用户。

Sharing the spreadsheet in this context doesn't mean anybody could open the spreadsheet directly as a document as long as the url of the spreadsheet remains unknown. The app will indeed need to have access to it if you deploy your app as 'User accessing the webapp' but no one can find the url of the sheet unless you publish it. I use this configuration very often but of course I don't know your exact use case... ;-) In my case the app itself determines what a specific user can do or not (by enabling /disabling certain functions / panels depending on the logged user.

这是一个这样的应用程序的例子,你可以找到源电子表格吗?

Here is an example of an app like this, can you find the source spreadsheet ?

我的电子表格有任何有链接的人,所以应用程序可以读取和写入,但电子表格及其url的名称是未知的(除了我),所以即使用户通过webapp在文档中写入某些内容,它也不会出现在用户的文档列表中(因为他从来没有真正打开过)我检查过不同的账户,并且从未发现任何异常。

My spreadsheet has "anyone with the link" so the app can read and write to it but the name of the spreadsheet and its url is unknown (except for me) so it never appears in the document list of the user even if the user "writes" something in the document through the webapp (since he never actually "opens" it). I checked that on different accounts and never found any exception.

这篇关于澄清活动用户范围和脚本授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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