Run Scripts as Other Users
You can use HAPI to run scripts as other users or as an anonymous user!
Note: CQL and HAPI
Where there are CQL statements in example scripts, you can use any CQL statements to modify the scripts to work for you. Visit the CQL Guide for help with CQL.
Run script as another user
The script that follows adds a label to every page in a space as another user.
Customize the above script
For tips on adding labels, visit Work with Labels.
Run script as anonymous user
To run this script, turn on anonymous access. To anonymously run a script to return all pages that have anonymous access, use a script like this in the Script Console:
Warning: A note about permissions
If you use a script that searches pages by ID, you can run the Pages.getById method even when global anonymous access is disabled.