Reputation: 11
I've written a app script(web app) to access spreadsheet and display it's content based on search criteria.
Web app should display content based on given name
It is working fine with my own gmail account. But when other users(given access for app script web app) tried this app they're seeing error as
"Exception: You do not have permission to access the requested document." It is throwing an error when SpreadsheetApp.openById(spreadsheetId) is executed.
By giving an explicit access(sharing with user) to the spreadsheet, he is able to access the data without any issue. But as spreadsheet is already published to the web to access by anyone, why should it required again an explicit access to execute spreadsheet.
Is there way to access spreadsheet data without sharing it with the end user? Thank you in advance for the help.
Upvotes: 1
Views: 110
Reputation: 2598
I understand that you published a web app that opens a certain Sheet. In the "Deploy as web app" menu (opened from the Apps Script editor and selecting Publish ⮞ Deploy as web app
) you would have been asked to determine how to "Execute the app as". You can choose between these values:
As a consequence of the second case, the users would need previous access to be able to open the Sheet. Since you want to give them access no matter what, I recommend to use the first option. Please, ask me any additional doubt.
Upvotes: 0