Categories
Programming Systems Administration

A Userscript to click the “Recover Permissions” button for every space in Atlassian Confluence Cloud

When administering a Confluence Cloud instance, we encountered the issue where I needed to use the API to check every space’s permissions.

However, in Confluence’s REST API, you need to have “Read” permissions on a space to be able to read the permissions. To get this access, you can (as an admin) go to the Space Settings, and click the “Recover Permissions” button.

However, we have over 600 spaces… so I didn’t want to do it by hand. There must be a way to script this, I thought! Alas, Atlassian doesn’t have any admin endpoints in their REST API – seriously, what is going on here Atlassian?

Instead, I needed to write a userscript, which is basically a small JS script that gets injected into the page and run in the context of your browser – very handy for doing little automation tasks on websites. Here it is in all it’s glory:

To start it running, you can use the the button in the ViolentMonkey extension, or press Alt-R on your keyboard.

Leave a Reply

Your email address will not be published. Required fields are marked *