Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to see all page restrictions in a single location?

Matt Parks
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.
January 26, 2021

I'm running Confluence DC 7.9.3 and I want to be able to see all of the page restrictions that have been created across the environment.

I know that I can go to each individual space and see the restricted pages there, but I don't want to have to go through all of the spaces we have and make notes for each space.

 

Whether it's part of the basic Confluence functionality or through a third-party plugin, is there a way that I can display, on a single page, a list of all of the restricted pages (and what spaces they are under)?

 

1 answer

1 accepted

0 votes
Answer accepted
Kian Stack Mumo Systems
Community Champion
January 26, 2021

@Matt Parks

The only plugin I see close to that is this one. The functionality you're looking for doesn't exist in Confluence out of the box. This plugin will show you page restrictions broken down as they apply to various groups, but I'm not sure that's quite what you're looking for.

Thanks,

Kian

Matt Parks
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.
January 27, 2021

@Kian Stack Mumo Systems 

Thanks for the quick reply. We keep most of our users in just a couple of groups that give them access to Confluence, so the restrictions are added at the individual user level. This means that most of the restrictions wouldn't show up in the above plugin.

I'll mark your answer as accepted.

Matt Parks
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.
July 30, 2021

I ended up creating something in scriptrunner that goes through all of the spaces and returns any pages that are restricted. I skip over the personal/archived spaces.

 

import com.atlassian.confluence.spaces.Space
import com.atlassian.confluence.spaces.SpaceManager
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.security.SpacePermission
import com.atlassian.confluence.pages.PageManager
import com.atlassian.confluence.pages.Page

PageManager pageMan = ComponentLocator.getComponent(PageManager)
SpaceManager spaceMan = ComponentLocator.getComponent(SpaceManager)

def spaces = spaceMan.getAllSpaces()
String allSpaces = ""

for (space in spaces)
{
if (space.isPersonal())
{
continue
}

if (space.isArchived())
{
continue
}

def permissions = pageMan.getPermissionPages(space) as List<Page>

for (permission in permissions)
{
if (!allSpaces.contains("${space.getName()}, "))
{
allSpaces = allSpaces + space.getName() + ", <br>"
}


}
}

return allSpaces
Sunny Kanade May 12, 2022

@Matt Parks: Thanks, below the line of code gives us the list of pages where restrictions are applied. Just that function name is a bit confusing, I think it should be getRestrictedPages(space) :)

 def permissions = pageMan.getPermissionPages(space) as List<Page>

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.9.3
TAGS
AUG Leaders

Atlassian Community Events