Macro to get all Page Restriction for a specific Group

Marcin Beczynski August 27, 2015

Hi All,

Guys there is a macro what will display all restriction associated with group ??

I mean for example you have a XXX group and type it intro plug in then got reply group XXX has page restriction at following space : ... 

 

Thanks in advice.

3 answers

1 accepted

4 votes
Answer accepted
lavitz slambert
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.
August 31, 2015

Hey @Marcin Wilczynski,

I've wrote simple query that will give you the page title, space name, group name and restriction type that the specific group have in Confluence:

select c.TITLE AS "Page Title", s.SPACENAME as "Space Name", cp.GROUPNAME as "Group Name", cp.CP_TYPE as "Restriction Type"
from CONTENT_PERM cp
inner join CONTENT_PERM_SET cps on cp.CPS_ID = cps.ID
inner join CONTENT c on c.CONTENTID = cps.CONTENT_ID
inner join SPACES s on c.SPACEID = s.SPACEID
where cp.GROUPNAME = 'secret-group';

Notes: 

  1. You need to change the secret-group in above query with the name of the group you want to check the restrictions.
  2. The above query was written on MS SQL Server, in case it fails in your DBMS let us know which one you use.
Thanks and Regards,
Lavitz - the guy that uses Confluence on Windows as a Hobby!

 

Marcin Beczynski August 31, 2015

Thanks man you save my day :)

1 vote
Marcin Beczynski August 27, 2015
Hi Lavitz

Thanks for your comment, I'm looking for macro what show page restriction instead of permission.

Regards.
lavitz slambert
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.
August 27, 2015

In confluence, the term, page restriction is meant to say, group x is the one that have "permission" to view and edit this page/space. However if a page don't have any restrictions applied all groups will be shown by that macro. I will try to write down a sql query to show all pages and spaces that have being restricted to a specific group in case no one shows up a better solution.

1 vote
lavitz slambert
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.
August 27, 2015

Hey Marcin,

There's a user macro that user @Andrew Frayling wrote that list all the groups of each space and it's permissions:

https://answers.atlassian.com/questions/50804/group-permissions-in-confluence?page=1

I did not tested but it might be a direction to achieve what you want.
Thanks and Regards,
Lavitz - the guy that uses Confluence on Windows as a Hobby!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events