如何使用Google Apps脚本识别用户?

问题描述 投票:2回答:1

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

authentication google-apps-script google-sites google-apps-script-web-application
1个回答
5
投票

我想,该脚本是在Execute the app as:组合框设置为me的情况下部署的。请检查它,并将组合框的值更改为User accessing the web app

© www.soinside.com 2019 - 2024. All rights reserved.