Permissions and types of scripts
The user identity that a script runs with — and thus the data it can access — varies based on the scenario in which the script is run, as shown in the table below.
|Type of script||Script runs as...|
|Standalone or bound to Google Docs, Sheets, or Forms||User at the keyboard|
|Custom function in a spreadsheet||Anonymous user; however, quota limits count against user at the keyboard|
|Web app or Google Sites gadget||User at the keyboard or script owner, dependent on options selected when deploying the app|
|Installable trigger||User who created the trigger|
Granting access rights
If a script uses services that can access private data, you'll see one of the sets of authorization dialogs below. Scripts that you have previously authorized will also ask for reauthorization if a code change adds new services. Scripts do not request authorization if they use only services that cannot access user data (like the URL Fetch service or the Language service), or if you access the script as a web app that runs under the script owner's user identity.
|Current authorization dialogs||Old authorization dialogs|
Revoking access rights
To revoke a script's access to your data, follow these steps:
- Visit the Authorized Access page for your Google account. You'll need to enter your password. (To navigate to this page in the future, visit Google.com, then click your account picture in the top-right corner of the screen. Next, click Account, then Security, then Review permissions.)
- Click Revoke Access next to the script whose authorization you want to revoke.
Upgrading authorization experience
By default, scripts created before July 2013 use an older version of the authorization flow. To upgrade a script to the new flow, select File > Upgrade authorization experience. As the confirmation dialog warns, upgrading to the new flow has a few side effects:
- Each existing user of the script will be prompted to reauthorize. (If you run the script on a trigger instead of directly, you'll still need to reauthorize it.)
- Any advanced Google services used by the script will need to be enabled again in the Google Developers Console.
- Upgrading to the new flow is irreversible.