How to remove all restrictions from pages within a space
Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
You'd like to switch to managing access to a space through global permissions and need to remove all the page level permissions
Solution
Shutdown Confluence
Backup your database
Run below query to find out the space id of the target space you want to remove the restrictions:
Warning: Backup your database before proceeding.
Before running any SQL in this article, create a full backup of your database. This is a database-level operation with no undo other than a backup restore. Only proceed if you're comfortable running SQL directly against the database, and test on a staging or cloned environment first, wherever possible.
Select SPACEID from SPACES WHERE SPACENAME = 'My Space Name';The example spaceid is '851969', once you get the id from above query, replace the number 851969 in below queries and run then sequentially:
delete from CONTENT_PERM WHERE CPS_ID IN (select ID from CONTENT_PERM_SET WHERE CONTENT_ID IN (select CONTENTID from CONTENT WHERE SPACEID = 851969 AND CONTENTTYPE = 'PAGE'));And:
delete from CONTENT_PERM_SET WHERE CONTENT_ID IN (select CONTENTID from CONTENT WHERE SPACEID = 851969 AND CONTENTTYPE = 'PAGE');Start Confluence.
Verification
After restarting Confluence, verify the restrictions have been removed by navigating to Space Settings > Content Tools > Restricted Pages for the target space. This view should now show no restricted pages. Optionally, spot-check a few previously-restricted pages by clicking their padlock icon to confirm the Restrictions panel shows no entries.
In case of any problems, please shutdown Confluence and restore the database by using the database backup taken from step 2.
Was this helpful?