-1

I'm creating a Google Spreadsheet with an attached script that adds some menu items (to merge the spreadsheet data to my local database). I'm going to be sharing this spreadsheet with clients, and I'd like them to have edit access to the spreadsheet itself. But I don't want them to be able to run any functions in my script, lest they modify my local database. Ideally, I'd like them not even to be able to see the menu items created by the script's onOpen method. Of course, I also don't want them to have view or edit access to the script code itself.

I know that the first time a script runs, Google asks you to authorize it. Is there a way for me to simply make it impossible for all but a few users to authorize the running of a script? I keep landing on this Apps Script Authorization support page, but that doesn't look helpful - I'm not trying to change a script's access to files; I want to change users' access to scripts.

1 Answers1

0

If you must keep the menus, at most you can prevent them from having script edit permissions and make it harder to view the code by placing it in a library.
There in the library use Session.getActiveUser().getEmail() to filter out othercallers.
To completely hide the code or ability to run it, make a separate script detached from the spreadsheet and publish as webapp with access to you only.

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36