问题
We first noticed this issue Friday, June 8. It could have been lurking for some time before that, as we don't use the add-on frequently. We first saw it running "Test as add-on..." from the project on script.google.com, regardless of version of code being tested. Then we had multiple users reproduce the issue from their own accounts, using the public addon downloaded from G Suite Marketplace. The public add-on dates back to May 2 and it was working fine when published.
Open any sheet in Google Drive, and get the Workforce Dimensions Admin add-on. Choose "Generate settings file" and get the error message "You do not have permission to call showModalDialog".
Is this a known issue affecting other add-ons as well?
回答1:
Yes, this is a known issue as there are several recent issues on the Google Apps Script Issue Tracker like the following:
- Critical: Google Docs Add ons show error "You do not have permission to call showSidebar"
- Error "You do not have permission to call showSidebar" in onOpen and onEdit
回答2:
The issue is still not fixed by Google, even adding the googleapis.com/auth/script.container.ui
the scope did not change anything for me, but I found a different way :
All you have to do is manually creating the onEdit
trigger in your Project's triggers, the scope will, therefore, be effective. It worked for me and the problem might be coming from the fact that you use a Simple Trigger and not an Installable one.
来源:https://stackoverflow.com/questions/50823019/you-do-not-have-permission-to-call-showmodaldialog