Hi everybody,
i'm trying to create a macro that will return the restricted pages for every space. I have create the following template for the macro
## Macro title: Restricted Pages
## Macro has a body: Y or N (N)
## Body processing: Selected body processing option
## Output: Selected output option
## Macro to list all restricted pages per space.
## @noparams
#set ( $spaces = $spaceManager.getAllSpaces() )
#set($contentPermissionManager=$containerContext.getComponent('contentPermissionManager'))
<table class="confluenceTable">
<tr>
<th class="confluenceTh">Space</th>
<th class="confluenceTh">Key</th>
<th class="highlight-red" data-highlight-colour="red">View Page Restricted to Users</th>
<th class="highlight-red" data-highlight-colour="red">View Page Restricted to Groups</th>
<th class="highlight-green" data-highlight-colour="green">Edit Page Restricted to Users</th>
<th class="highlight-green" data-highlight-colour="green">Edit Page Restricted to Groups</th>
</tr>
#foreach ( $space in $spaces )
#if ($space.isGlobal())
<tr>
#set($result=$space.getDescription().getDescriptionTitle())
<td class="confluenceTd"><a href="$req.contextPath$space.getUrlPath()">$space.getName()</a></td>
<td class="confluenceTd"><a href="$req.contextPath$space.getUrlPath()">$space.getKey()</a></td>
<td class="highlight-red" data-highlight-colour="red">
##In this cell i want to have the pages of space with view restriction to users
</td>
<td class="highlight-red" data-highlight-colour="red">
##In this cell i want to have the pages of space with view restriction to groups
</td>
<td class="highlight-green" data-highlight-colour="green">
##In this cell i want to have the pages of space with edit restriction to users
</td>
<td class="highlight-green" data-highlight-colour="green">
##In this cell i want to have the pages of space with edit restriction to groups
</td>
</tr>
#end
#end
</table>
The thing that i'm missing is how i will get the restricted pages per space. I had a look in Confluence's Api but i didn't manage to get the results that i want it.
For the restricted pages i would like to have both types of restriction (View and Edit)
Thanx in advance,
Kostas