Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,039
Community Members
 
Community Events
165
Community Groups

Confluence - Scriptrunner: How could I automatically remove restrictions of multiple pages?

Edited

Hi,

I want to determine who can view and / or edit individual pages with a specific string included in their content.

The script I would like to use is to remove all users except the page creator so that only the page creator can view and edit this page.


for example:

I want to restrict all pages that contain the "Hello" string in the content.
I'm running a script that relies on a specific string.

Once I run the script all viewing permissions from these pages will be removed except the page creator.

 

Continuing with the question,

Let’s say the page creators edit the page and remove the “Hello” string, after I run my script again, these pages will no longer be restricted. (Like a rollback).

Is there a way to do that?

Any reply will be welcomed!

Thanks

1 answer

0 votes
Laurens Coppens Community Leader Nov 04, 2021

Hi Guy,

 

I'm not the best scripter, but as you already have a script that uses that string, i would suggest to extend that with remove content permissions: https://docs.atlassian.com/atlassian-confluence/6.6.0/com/atlassian/confluence/core/ContentPermissionManager.html

Hope this helps,

Laurens

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

364 views 0 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you