how to indentify user using google apps script?
Asked Answered
S

1

3

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?

Specialty answered 29/8, 2012 at 7:28 Comment(0)
P
6

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.

Priapitis answered 29/8, 2012 at 7:46 Comment(4)
yes, checked 'Execute app as :' (for gmail domain) and combo-box is set like you told but still the same problem there.Specialty
@ViralShah, I wrote about two values me and User accessing the web app. Which value do you have?Priapitis
having writes of my deployed app to User accessing the web app. still problem remaining..Specialty
@ViralShah. I created a simple script which works correctly. The deployed script is here. The source is here. The deploy option Execute the app as is User accessing the web app. The Active User label contains correct email for different accounts. Can u create similar script which does not work and publish it in similar way as I did?Priapitis

© 2022 - 2024 — McMap. All rights reserved.