How to remove all restrictions from a specific page via the database

Still need help?

The Atlassian Community is here for you.

Ask the community


Purpose

If you'd like to remove page level permissions for a specific page via the database

Solution

  1. Shutdown Confluence
  2. Backup your database
  3. Run below queries to replacing page title with title of the page you'd like to have the permissions removed from:

    Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.


    DELETE from CONTENT_PERM WHERE CPS_ID IN (select ID from CONTENT_PERM_SET WHERE CONTENT_ID IN (select CONTENTID from CONTENT where title='page title'));
    DELETE from CONTENT_PERM_SET WHERE CONTENT_ID IN (select CONTENTID from CONTENT WHERE title='page title');
  4. Start Confluence


Note

Removing single user from the Page Restrictions

Sometimes, we may need to remove single users from the page restrictions via database using the page title and the username which needs to be removed using below query.

DELETE from CONTENT_PERM WHERE CPS_ID IN (select ID from CONTENT_PERM_SET WHERE CONTENT_ID IN (select CONTENTID from CONTENT where title='Restrict')) AND username = (select user_key from user_mapping where lower_username='test');



Last modified on Jun 22, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.