Make restrictions visible on page

We have restrictions based on groups in our confluence-setup.

In order to avoid accidentally adding content that should only be visible for Group A to a page that's also visible for Group B, I'd like to have the groups that have access to the page visible directly on the page.

Is there a way to do this?

Currently we use the workaround to add tags like <Group A> <Group B> to the page. However, the more content is added, the more difficult it becomes to keep the tags in sync with the actual restrictions...

1 answer

1 vote
Davin Studer Community Champion Oct 23, 2013

Here is a user macro that you can use to show the page permissions.

## Macro title: restrictions
## Macro has a body: N
## Developed by: Davin Studer
## Date created: 10/24/2013
## @noparams

###################
##    Viewers    ##
###################
#set ($vPerms = $content.getContentPermissionSet("View"))
#if ($vPerms &amp;&amp; $vPerms.size() &gt; 0)
    Viewing Groups:&lt;br /&gt;
    &lt;ul&gt;
    #foreach($vPerm in $vPerms)
        #if($vPerm.isGroupPermission())
           &lt;li&gt;$vPerm.getGroupName()&lt;/li&gt;
        #end
    #end
    &lt;/ul&gt;
    Viewing People:&lt;br /&gt;
    &lt;ul&gt;
    #foreach($vPerm in $vPerms)
        #if($vPerm.isUserPermission())
           &lt;li&gt; $vPerm.getUserSubject().getFullName()&lt;/li&gt;
        #end
    #end
    &lt;/ul&gt;
#end

###################
##    Editors    ##
###################
#set ($ePerms = $content.getContentPermissionSet("Edit"))
#if ($ePerms &amp;&amp; $ePerms.size() &gt; 0)
    Editing Groups:&lt;br /&gt;
    &lt;ul&gt;
    #foreach($ePerm in $ePerms)
        #if($ePerm.isGroupPermission())
            &lt;li&gt;$ePerm.getGroupName()&lt;/li&gt;
        #end
    #end
    &lt;/ul&gt;
    Editing People:&lt;br /&gt;
    &lt;ul&gt;
    #foreach($ePerm in $ePerms)
        #if($ePerm.isUserPermission())
            &lt;li&gt;$ePerm.getUserSubject().getFullName()&lt;/li&gt;
        #end
    #end
    &lt;/ul&gt;
#end

Davin Studer Community Champion Oct 23, 2013

I realize that the output of this user macro is certainly not pretty(I'm no designer). You might want to edit it to look a little nicer, but the functionality is there.

Davin Studer Community Champion Oct 28, 2013

Hmmm. Just realized that you tagged the question as confluence-ondemand. In that case there is no way.

Right, I tried to try your suggestion out, only to find that I'm pretty limited by using on-demand :-(

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,087 views 25 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you