Google Script App - Allow Access for Anonymous Users

I have read the following topics:

I have a very simple binding script that will add a menu item to the add-in menu. From what I've gathered, this is possible regardless of the authMode user and the way your script is posted .

function onOpen(e) {
  var menu = SpreadsheetApp.getUi().createAddonMenu();
  menu.addItem('Alert', 'alert');
  menu.addToUi();
}

function alert() {
  SpreadsheetApp.getUi().alert('alerted');
}
      

Run codeHide result


This works for all registered users, but not for anonymous users. When opening a sheet as an anonymous user, the menu option doesn't even exist. As suggested in the second post above, I also created a settable trigger for my onOpen function, but it still doesn't work. The install trigger should run as the user who created the script and I allowed it.

I also shared the link as "Anyone whose link can edit". Am I misinterpreting something? It looks like this shouldn't be a big problem.

Any help would be greatly appreciated. If you need more information, please let me know and I have provided it.

+3


source to share


2 answers


Scripts cannot be accessed or run by anonymous users unless they are deployed as a web application, and even then the anonymous user can only access the interface.



In your linked script, you will see that users who are not logged in cannot even access the script editor by clicking on tools -> script Editor (but all registered users can). Also, if you have a standalone script on your Drive and you right click and share with "Anyone on the Internet can edit", anonymous users are still required to be logged in.

+4


source


I see the same behavior. Interestingly, I can't even open the Script editor as an anonymous user to confirm that the Script is there, even though this menu item is not greyed out.

Everything works fine as soon as I log into an unlinked account.



This might be a bug, or it might be an undocumented limitation, or it might be a temporary issue that will be resolved.

I think you have set everything up correctly.

0


source







All Articles