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...
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 && $vPerms.size() > 0)
Viewing Groups:<br />
<ul>
#foreach($vPerm in $vPerms)
#if($vPerm.isGroupPermission())
<li>$vPerm.getGroupName()</li>
#end
#end
</ul>
Viewing People:<br />
<ul>
#foreach($vPerm in $vPerms)
#if($vPerm.isUserPermission())
<li> $vPerm.getUserSubject().getFullName()</li>
#end
#end
</ul>
#end
###################
## Editors ##
###################
#set ($ePerms = $content.getContentPermissionSet("Edit"))
#if ($ePerms && $ePerms.size() > 0)
Editing Groups:<br />
<ul>
#foreach($ePerm in $ePerms)
#if($ePerm.isGroupPermission())
<li>$ePerm.getGroupName()</li>
#end
#end
</ul>
Editing People:<br />
<ul>
#foreach($ePerm in $ePerms)
#if($ePerm.isUserPermission())
<li>$ePerm.getUserSubject().getFullName()</li>
#end
#end
</ul>
#end
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm. Just realized that you tagged the question as confluence-ondemand. In that case there is no way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right, I tried to try your suggestion out, only to find that I'm pretty limited by using on-demand :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.