如何使用谷歌应用程序脚本识别用户? [英] how to indentify user using google apps script?

查看:23
本文介绍了如何使用谷歌应用程序脚本识别用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方法来识别用户.我有一个谷歌网站,用户可以通过他们的 gmail 帐户访问.我的站点旨在允许用户查看任何数据,但只能编辑他们自己的数据.这对我来说很好用,因为我是站点的所有者和脚本的发布者,但是 Session.getActiveUser().getUserLoginId() 为其他人返回 null.
请为我提供有关此问题的解决方案.任何链接/任何一段代码?

I need a way to identify users. I have a Google site that is users access via their gmail accounts. My site is designed to allow users to view any data, but edit only their own data. This works fine for me as I'm the owner of the site and publisher of the scripts, but Session.getActiveUser().getUserLoginId() returns null for anyone else.
Please provide me the solution about this problem. Any link / any piece of code?

推荐答案

我想,脚本是使用 Execute the app as: 组合框设置为 me 部署的.请检查它并将组合框值更改为User accessing the web app.

I suppose, that the script is deployed with the Execute the app as: combobox set to me. Please check it and change the combobox value to User accessing the web app.

这篇关于如何使用谷歌应用程序脚本识别用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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