How to add/update Page restrictions using API calls in Confluence SERVER

Ritika Saini April 28, 2023

Task- Write a Python script to add restrictions to a page in Confluence Serversuch that no one can read/update it. Something like this... but for Server

 

Screenshot (242).png

 

I have read these questions but they are pretty old and unsupported solutions, are there any better (updated and working) solutions??

1 answer

1 accepted

1 vote
Answer accepted
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2023

Hello @Ritika Saini 

Confluence Server doesn't have any REST API endpoints to add / change content restrictions, only ones to read them.

Only Confluence Cloud has those types of REST API endpoints.

Ritika Saini April 28, 2023

aren't there any alternatives to achieve this?

David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2023

There are two alternatives.

  1. Follow the advice that @Nic Brough -Adaptavist- gave you in this thread, and buy ScriptRunner which will allow you to run the script to add restrictions to pages using the old Java API and the ContentPermissionManager class, as described on this thread.
  2. Stop using Confluence Server and switch to Confluence Cloud.

Choose one.

Have fun!

Like Ritika Saini likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events