The following Google Apps Script code is designed to check that a user has approved all required permissions/scopes before trying to run some of your code bound to a Google Sheet file. This is somewhat in response to Google
rolling out Granular OAuth consent which creates confusion for end users and additional work for developers.
You tell the function which scopes are required in order for the tool to run effectively and it will verify that the user has accepted all of them before then running the rest of your code.
 |
| Screenshot of popup informing user they are missing some permission |