Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to find all pages with view restrictions

Matthias Born
Contributor
October 20, 2022

Hello community!

We are migrating 500++ spaces from server to cloud with thousands of view restricted pages (page restrictions, not space permissions).

For some REST API scripting tasks I need access to all these pages. 

Does anybody has an idea, how

  • I can find all view restricted pages and 
  • Add view/edit restrictions for a user or a group?

Don't get me wrong: I know how to find restricted pages in the space admin section. But only one by one. I also know that a space++ administrator has the right to give himself access to every page. Again: One by one. 

But that's not feasible. We are talking about 2000++ pages I can't see.
What I need is a bulk action to find all these pages.

Any ideas?

Thx!

Matthias

1 answer

0 votes
Sayed Bares [ServiceRocket]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

Hi Matthias, 

Welcome to the community!

To find the view restriction,  you might want to consider https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-get and for adding restriction you might want to consider https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-post by querying all of your 2000++ pages

KC Wong
Contributor
November 23, 2023

That is useless if you are not already included in the restrictions.

Even if you have the space permission to administer and modify restrictions, if you are not already in the page's restrictions, you don't even see the page.

The REST API to get all pages will not include restricted pages you don't have access to.

The REST API to modify restrictions will return 404 as if the pages don't exist. Not to mention they need the page ID in the path which you cannot get with other REST APIs. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Upcoming Confluence Events