Allow administrators to edit a restricted page


In the opposite of some other questions, it there any "automated" or "general configuration" way to allow an administrator to change the restriction on a confluence page?

Let me explain...

Due to some infrastructure change we might need to update several pages on a confluence with the help of a script. There are different solutions based on the Confluence CLI or with python.

However the page edit fails if the page is restricted.

An administrator can view a restricted page (as long as he knows the url) and even change the restriction on this page in order to allow himself to edit its content. He can also remove this permission then after.

Conclusion: An administrator can change the page permission on a restricted page via the GUI. Is there any equivalent solution with script? Alternativaly is there any general configuration that would allow an administrator to edit every page?

Thanks in advance,
Best regards,

3 answers

1 accepted

0 votes
Accepted answer

Eventually I found the python solution thanks to the

pageperms = client.confluence2.getContentPermissionSet(token, page['id'], 'Edit');

    tmppageperms = copy.deepcopy(pageperms)
    for contentPermission in tmppageperms['contentPermissions']:
        if contentPermission['userName'] == user:
    if ('contentPermission' not in locals() or contentPermission['userName'] != user):
        tmppageperms['contentPermissions'].append({'userName': user, 'type': 'Edit'})

    client.confluence2.setContentPermissions(token, page['id'], 'Edit', tmppageperms['contentPermissions']);
    raw_input('Press Enter to continue...')
    client.confluence2.setContentPermissions(token, page['id'], 'Edit', pageperms['contentPermissions']);

To be combined with the update page routine as described in this other article

  1. You can download a xml export of your space.
  2. Then edit it witth a script
  3. Delete the space
  4. Upload your modified export



Thanks you Steve for this other solution.

I think it's a bit tricky to delete a space so I would rather avoid this.

Using Confluence Command Line Interface and the addPermissions action:

confluence --action addPermissions --space Experiment --title myPage --permissions view,edit --userId automation

Ah yes I did not see this action. Thanks for the info.

The thing is I started with a python script and I discovered later that Confluence CLI can also update the page content (eg getSource+storePage).

I'm sure there's a solution with python but I could not find it.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

915 views 45 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you