Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can a non-admin user tell who is the Space Admin for a Space to which the user does not have access?

JamesT
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2015

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.

2 answers

1 accepted

0 votes
Answer accepted
JamesT
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2015

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
1 vote
Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2015

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>
JamesT
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2015

Sorry, newbie to wiki markup (but not HTML & CSS). Which menu sequence do I go thru to enter that?

Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2015

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events