Is there a macro to display all users, who are allowed to watch a page?
We have users who want to know beforehand, who will be able to read something they post.
Here is a user macro I created that shows the restriction set on a page. This will only show the page restrictions ... meaning it doesn't take into account space permissions.
## Developed by: Davin Studer ## Date created: 10/24/2013 ## @noparams #set ($vPerms = $content.getContentPermissionSet("View")) #set ($ePerms = $content.getContentPermissionSet("Edit")) #set ($viewSize = $vPerms.size()) #set ($editSize = $ePerms.size()) #if(!$viewSize) #set($viewSize = 0) #end #if(!$editSize) #set($editSize = 0) #end #if($viewSize == 0 && $editSize == 0) There are no restrictions set.<br /> #else ################### ## Viewers ## ################### #if ($viewSize > 0) Viewers:<br /> <ul> #foreach($vPerm in $vPerms) #if($vPerm.isGroupPermission()) <li>$vPerm.getGroupName() (Group)</li> #end #end #foreach($vPerm in $vPerms) #if($vPerm.isUserPermission()) <li> $vPerm.getUserSubject().getFullName() (User)</li> #end #end </ul> #else There are no view restrictions set.<br /> #end ################### ## Editors ## ################### #if ($editSize > 0) Editors:<br /> <ul> #foreach($ePerm in $ePerms) #if($ePerm.isGroupPermission()) <li>$ePerm.getGroupName() (Group)</li> #end #end #foreach($ePerm in $ePerms) #if($ePerm.isUserPermission()) <li>$ePerm.getUserSubject().getFullName() (User)</li> #end #end </ul> #else There are no edit restrictions set.<br /> #end #end
This could be expand to show space permissions as well using ... $spaceManager.getSpace($content.spaceKey).getPermissions()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ah, great. We are not very good at coding macros at the moment, but i will look into it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Davin Studer. I like this macro, but It does not include inherited restrictions
Can it be expanded with this functionality?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much for your input. This is one part of the game, but the space permissions is exactly what we need on top.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.