It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Is there a way in Confluence to list all the spaces a group, say group X, has permissions on?
I'd like to avoid going manually through every space permissions page and look for the presence of group X...
Instead it would be useful to report on the list of spaces Group X has access to, but I can't find any hint in documentation of macros, plugins,...
Thanks in advance
We created a user macro with similar functionality. Maybe something like this:
## @param Group:title=Group|type=string|required=true|desc=The group to check permissions All spaces where group "$paramGroup" has VIEWSPACE permission: #set($allSpaces=$spaceManager.getAllSpaces()) <ul> #foreach($space in $allSpaces) #set($spacePermissions=$space.getPermissions()) #foreach($permission in $spacePermissions) #if ($permission.getType() == 'VIEWSPACE' && $permission.getGroup() == $paramGroup) <li><a href="$req.contextPath/spaces/spacepermissions.action?key=$space.key">$space.name ($space.key)</a></li> #end #end #end </ul>
Hope this helps
Hi, this looks very helpful, but I'm not quite sure how to use it. I created a macro using the cod you pasted above. Referencing it like
{my_get_spaces_macro:title=my_group_name}
results in a list of users. Would you mind giving an explanation as to how to use it? Thanks, Julie
If you create a user macro called "group-permissions" using the code above and reference it like:
{group-permissions:Group=confluence-users}
Then you should see something like the following output:
All spaces where group "confluence-users" has VIEWSPACE permission:
is it possible to do the same thing for each User individually - i.e. list the Spaces that Fred has access to, followed by John's Spaces, followed by Percy's Spaces .... for all Users?
The user macro here is brilliant, but like Rodney I'm struggling to modify it to display the same information for an individual user. Not sure what I'm doing wrong but replacing group with user doesn't work and I can't find anything helpful in the Confluence documentation
The following macro should work for individual users:
## @param User:title=User|type=username|required=true|desc=Select user to check permissions All spaces where user "$paramUser" has VIEWSPACE permission: #set($allSpaces=$spaceManager.getAllSpaces()) <ul> #foreach($space in $allSpaces) #set($spacePermissions=$space.getPermissions()) #foreach($permission in $spacePermissions) #if ($permission.getType() == 'VIEWSPACE' && $permission.getUserName() == $paramUser) <li><a href="$req.contextPath/spaces/spacepermissions.action?key=$space.key">$space.name ($space.key)</a></li> #end #end #end </ul>
Hope this helps
Thank you - that was an amazingly quick reply. It works better than what I was trying, but doesn't report on the spaces that a user has access to via group membership. Presumably it would be possible to extend it the macro to report on all spaces that a user can see (via group membership or user permissions)?
The goal of the macro was to find spaces where the group/user has been given explicit permissions, not implicit via group membership.
Maybe this macro is what you are looking for:
https://answers.atlassian.com/questions/73701/macro-to-get-all-permissions-for-a-specific-user
Thank you for pointing me to the other question. I'll experiment with the macros there. I didn't find that one when I was searching before - I often find it hard to find what I'm looking for in "Answers" although there is so much useful information here.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.