Search code examples
google-apps-scriptgoogle-sheetsweb-applications

Google apps script deployment permissions required separately for spreadsheet?


When running the app Getting: You do not permission to access requested document line 66. (offending line is attempting to open a spreadsheet:

var ss = SpreadsheetApp.openByUrl(url);

Do I need to set permissions separately for both the spreadsheet and the application?

I deployed code as a web app, with permissions set to 'anyone'. I selected: Who has access to the app: to 'Anyone', and Execute the app as: 'User accessing the web app'

I want to share the app with colleagues.


Solution

  • Yes. You need to set permissions separately for both the spreadsheet and the application if you set the web app to run as User accessing the web app. This is not needed if you set the webapp to run as Me.