Search code examples
google-apps-scriptgoogle-sheetsgoogle-apps-script-addon

"You do not have permission to call showModalDialog"


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?


Solution

  • From comment #65 to Critical: Google Docs Add ons show error "You do not have permission to call showSidebar"

    Hello,

    We have introduced a new scope - "https://www.googleapis.com/auth/script.container.ui". For most add-ons the new scope requirement should have been added to the add-on automatically. In this case Apps Script did not detect that the add-on requires the scope because the reference to the top level bean "SpreadsheetApp" is in a different file than the function "showSidebar()". In order to resolve similar issues, developers should ensure both top level bean and bean method are referenced in the same file or explicitly declare all scopes requirements in the manifest. For more information on explicit scopes, please reference https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes.

    Thanks, Peter


    Yes, this is a known issue as there are several recent issues on the Google Apps Script Issue Tracker like the following: