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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

685 views 21 12
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