This is related to https://answers.atlassian.com/questions/16292, but there have been no satisfactory answers there for 3 1/2 years.
We have spaces which are restricted. They are NOT open to anonymous access, nor are they open to general groups like "confluence-users". When a non-authorized user accesses a Space like that, they get "You are not permitted to perform this operation", which isn't very helpful. Then they email me (the Confluence Admin), and i need to look up the Space owner and ask if the user can have access, RO or RW.
That's a big waste of time, for the users and for me!
How can I create an auto-updating page/macro/etc that lists all Spaces and who the Space Admins are? I know I could create it manually, but I'd like to avoid having that maintenance too, if possible.
Thanks to @Jonathan Simonoff for his suggestion. That code was targeted at every page in a Space or the whole Site, and I just wanted a single page (accessible to ALL) that would list ALL Space Admins. Using Jonathan's code and some more searching, I came up with this user macro which I instantiated on a globally-accessible page:
## @noparams #set ($allSpaces = $spaceManager.getAllSpaces()) #foreach ($space in $allSpaces) #set($permissionCount = 0) #if($space.getSpaceType() == "global") <b><a href="$req.contextPath/display/$space.getKey()">$space.name</a>: </b> #foreach ($permission in $space.getPermissions()) #if ($permission.getType() == "SETSPACEPERMISSIONS") #set($permissionCount = $permissionCount + 1) #if ($permissionCount == 1) #set($sepchar="") #else #set($sepchar=" / ") #end #if($permission.isGroupPermission()) #set ( $memberList = $userAccessor.getMemberNamesAsList($userAccessor.getGroup($permission.getGroup())) ) #foreach ($member in $memberList) $!sepchar #usernameLink($member) #set($sepchar=" / ") #end #end #if ($permission.isUserPermission()) $!sepchar #usernameLink($permission.getUserName()) #end #end #end <br><br> #end #end
I added this to the bottom of the page layout, just before #GENERAL PAGE DECORATION ENDS. This only works in spaces that use the default theme.
<p style='font-size:12px;color:gray'> Administrators for this space: #set($sepchar="") #foreach ($permission in $space.getPermissions()) #if ($permission.isUserPermission() && $permission.getType() == "SETSPACEPERMISSIONS") $!sepchar #usernameLink($permission.getUserName()) #set($sepchar=",") #end #end </p>
Sorry -- that would need to be installed by an admin. Go to Layouts in the admin interface, and edit the page layout. You can do that on the individual space level or for the whole site, which is what we did. FYI -- that isn't wiki markup -- it is Velocity, the page layout language used in Confluence.
Hi my Community friends! For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...
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!
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