-
Type:
Suggestion
-
Resolution: Unresolved
-
None
-
Component/s: User - Global / Space Permissions
-
None
-
2
-
3
Problem
Limit the ability to purge pages from trash or purge all trash from space to Global administrators instead of space administrators.
Suggested Solution
Confluence administrators can have the option to allow or not space admins to purge the trash.
Why This Is Important
Confluence administrators may want to have more control over who can delete pages from trash.
Workaround
Option 1 - CSS customization
- Go to Confluence administration > Global Stylesheet
- Click edit and add the following:
#content #space-tools-body ul.static-menu { display: none; } #space-tools-body table tbody tr td a[href*="purgetrashitem"] { display: none; }
- Save
If the space has customized stylesheets, it will overwrite the global settings, you will need to do the same on each space with customizations.
Option 2 - Edit velocity file
- Open file <confluence_install>/confluence/pages/viewtrash.vm
- Remove lines:
<ul class="static-menu"> <li><strong><a href="${linkPrefix}emptytrash.action?key=$generalUtil.urlEncode($key)">$action.getText('purge.all')</a></strong> – $action.getText('text.purge.all.desc')</li> </ul>
- Edit the following line from:
<td align="center" nowrap> <a href="${linkPrefix}restoretrashitem.action?key=$htmlUtil.urlEncode($key)&contentId=$trash.id">$action.getText('restore.name')</a> · <a href="${linkPrefix}purgetrashitem.action?key=$htmlUtil.urlEncode($key)&contentId=$trash.id">$action.getText('purge.name')</a> </td>
to:
<td align="center" nowrap> <a href="${linkPrefix}restoretrashitem.action?key=$htmlUtil.urlEncode($key)&contentId=$trash.id">$action.getText('restore.name')</a> </td>
Please be aware that the workarounds above are unsupported and are considered a customization in Confluence code according to Atlassian Support Offerings.In addition to this, it applies to all spaces in Confluence (not just one) and it needs to be re-applied after every Confluence upgrade.
This will only hide the buttons, if the space admins have the URLs to purge pages or all the trash they will still be able to purge the trash.