Hi all i am new to confluence and we are using script runner for confluence and we want list of permissions which a space have using groovy ..can anyone help me in this ..TIA
What are you actually trying to achieve with this?
Most "I want to see the permissions of a space" questions can be answered by "look at the space permissions page in admin". A request to do it with a script suggests you want to actually do something more clever, and rather than just give you a piece of it, it may be that we can give you a script that can do most of the task.
Hi Nic tnq for the quick response actually we want get the spaces list which were enabled the anonymous access by script runner for confluence for that we need a script can you please help me in this...
Ah, that makes sense.
I don't have a script for that, but I have a user-macro bookmarked that does something similar and could be adapted easily (a user-macro is probably a bit more useful than a script in this case, because you can put it on a page restricted to admins and then visit the page whenever you need it, rather than go look for a script every time).
This in fact lists all your administrators
#set($spaces = $spaceManager.getAllSpaces()) <table class="confluenceTable"> #foreach($thisSpace in $spaces ) #if ($thisSpace.isGlobal() ) <tr> <td class="confluenceTd"> <img class="space logo" width="32" height="32" src="$spaceManager.getLogoForSpace($thisSpace.key).getDownloadPath()" alt="$thisSpace.key"/> $thisSpace.getName() </td> <td class="confluenceTd"> #set($spaceAdmins = $spaceManager.getSpaceAdmins($thisSpace )) #foreach($spaceAdmin in $spaceAdmins ) #usernameLink($spaceAdmin.name)<BR> #end </td> </tr> #end #end </table>
But you could replace the "set($spaceadmins = ..." area with something like
#set($permissions = $thisSpace.getPermissions())
#foreach($perm in $permissions)
$perm <BR>
#end
This would give you everything, which might be a bit much, I'd probably want to put in an "if" to only dump out the permissions I'm interested in
Hi Nic ...the macro is not working
It looks like you're new here. Sign in or register to get started.