Hi All,
as a Confluence admin I need to achieve an overview. Hence, we have already more than 140 different spaces and 3 times more groups, it's very cumbersome to overview the space permissions, groups and users.
I'd liket to implement a macro which display the groups, permissions and users of each spaces, this way:
SpaceA
group1
permission(s) of the group in this space: e.g. VIEWONLY, ADMIN, etc.
user list of this group
group2
permission(s) of the group in this space: e.g. VIEWONLY, ADMIN, etc.
user list of this group
.....
SpaceB
groupX
permission(s) of the group in this space: e.g. VIEWONLY, ADMIN, etc.
user list of this group
.....
So, this macro would be on a page especially serves the admins to have an overview.
I got several macro code yet, which are give solutions for these features but apart:
This macro displays the groups and the group's user list of a space:
#foreach ($permission in $space.getPermissions()) #if ($permission.isGroupPermission() && $permission.getType() == "VIEWSPACE") #set ( $groupString = $permission.getGroup() ) #set ( $groupObject = $userAccessor.getGroup($groupString) ) #set ( $memberList = $userAccessor.getMemberNamesAsList($groupObject) ) <h3>$groupString</h3> <table class="confluenceTable"> <tr> <th class="confluenceTh">Space Administrators</th> </tr> #foreach ($member in $memberList) <tr> <td class="confluenceTd">#usernameLink($member)</td> </tr> #end </table> #end #end #foreach ($permission in $space.getPermissions()) #if ($permission.isGroupPermission() && $permission.getType() == "COMMENT") #set ( $groupString = $permission.getGroup() ) #set ( $groupObject = $userAccessor.getGroup($groupString) ) #set ( $memberList = $userAccessor.getMemberNamesAsList($groupObject) ) <h3>$groupString</h3> <table class="confluenceTable"> <tr> <th class="confluenceTh">Space Administrators</th> </tr> #foreach ($member in $memberList) <tr> <td class="confluenceTd">#usernameLink($member)</td> </tr> #end </table> #end #end #foreach ($permission in $space.getPermissions()) #if ($permission.isGroupPermission() && $permission.getType() == "SETSPACEPERMISSIONS") #set ( $groupString = $permission.getGroup() ) #set ( $groupObject = $userAccessor.getGroup($groupString) ) #set ( $memberList = $userAccessor.getMemberNamesAsList($groupObject) ) <h3>$groupString</h3> <table class="confluenceTable"> <tr> <th class="confluenceTh">Space Administrators</th> </tr> #foreach ($member in $memberList) <tr> <td class="confluenceTd">#usernameLink($member)</td> </tr> #end </table> #end #end
This macro list the groups with all the spaces having access to:
<h1>Groups</h1> ## get all the groups #set ( $allGroups = $userAccessor.getGroupsAsList() ) ## get all the spaces #set ( $allSpaces = $spaceManager.getAllSpaces() ) #foreach ($group in $allGroups) <h2>$group</h2> #foreach ($space in $allSpaces) <h3>$space.getName()</h3> #foreach ($permission in $space.getPermissions()) #if ($permission.isGroupPermission()) #if ($permission.getGroup() == $group) $permission.getType()<br /> #end #end #end #end #end
This macro list the permissions of a group on a particular space:
## Macro title: Group Permissions ## Macro has a body: Y or N (N) ## Body processing: Selected body processing option ## Output: Selected output option ## ## Developed by: Andrew Frayling ## Date created: 06/05/2012 ## Installed by: <your name> ## Macro loops through every group and every space listings permissions on that space grouped by group ## @noparams <h1>Groups</h1> ## get all the groups #set ( $allGroups = $userAccessor.getGroupsAsList() ) ## get all the spaces #set ( $allSpaces = $spaceManager.getAllSpaces() ) #foreach ($group in $allGroups) <h2>$group</h2> #foreach ($space in $allSpaces) <h3>$space.getName()</h3> #foreach ($permission in $space.getPermissions()) #if ($permission.isGroupPermission()) #if ($permission.getGroup() == $group) $permission.getType()<br /> #end #end #end #end #end
(Thanks to Andrew!)
So the features are apart but how can they achieve my requrement?
Can you please suggest?
Thanks in advance!
Rumi
This is what we use:
{cache:refresh=7d|showRefresh=true|showDate=true} {cli:profile=confluence|hideOutput=true|subdirectory=.} -a getSpacePermissionList --file spacePermissions.csv {cli} {csv:script=#cli/spacePermissions.csv|autoNumber=true} {csv} {cache}
This uses Confluence CLI Plugin (needs 2.6.0 or higher), Confluence Cache Plugin, Confluence Table Plugin
Hi Bob,
thanks for the suggestion!
It would be the most simpliest solution, but we have a strict plugin policy, so we have to test the plugins first and then implement. Unformtunately we don't have the CLI and cache plugins?
Is there a macro for this? Or a different solution with plugins?
We don't need csv export, I would like to display on a page (like the macros I posted above).
Thanks in advance!
Rumi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The CLI function can be run from the command line directly without any plugins. So, you can get the information immediately. However, if you need something to show within Confluence then you need at least some plugin. If you do the table plugin and add the csv produced by the command line as an attachment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, but we don't need to export. As I see this is because the csv plugin is used. We want to display everything on a page (like the macros above).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This macro displays the groups and the group's user list of a space: This macro code block is not working for me.
I want to create a macro where the input parameter would be the username and the macro should return me all the space to which i have access and the information of the space.
Can anyone help me in doing this, as im completely new to the macro concept.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are there any resolutions to this yet? 5 years later, and this is still something I need to figure out how to do? Does anyone have a solution for seeing all granular permissions for all spaces, in a concise report?
thanks, Pam
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.
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.