“Page administration” pages are hidden elements. They are created, as far as I recognized, that moment you set a specific right or forbid a right. So far so clear.
But why are those pages still there, if all checkboxes are empty. There are no checks and no stop signs. This moment I expect, this page to disappear.
We have only very few spaces with specific rights. Sometimes we test rights on special pages or spaces but remove them later, to have them for all again. That unused “page administration” pages are annoying us. We as admin has to see all hidden pages. So we see all this “page administration” pages and have to check, if all rights are correct there - or better: are there no rights set - do they inherit from parent?
Is there a possibility to delete those “page administration” pages we don’t need anymore? I don’t see any button for this. Would be nice, if those “unused” pages would disappear by themself in the future.
Yes, they are hidden.
As Admins we want a quick overview, if everything is ok. So we always see hidden pages.
If we see one of those WebPreferences we have to click and look what is set in there. Could be wrong settings. But a lot of those haven’t set anything.
But they exist, only because we had set something long time ago but not yet anymore. It’s time consuming to review WebPreferences that do nothing.
What’s time-consuming is checking all these pages manually in general (whether they have changes or not).
I’d suggest that you create a script to do that automatically and list WebPreferences pages that have data set and list them all in a single page if they have settings. That’s quite easy to do.
You’ll need to read the XWiki.XWikiPreferences xclass, iterate over all its xroperties metadata to find the xproperty field names.
Then, with a query you can find all WebPreferences and for each you iterate over all the xproperty field names and if not empty or null then you display them.
So your need is more of a need to have a proper global overview of rights set on the wiki, so that you don’t have to check individually all WebPreferences page, in case they may have some wrong settings in them.
For that you may want to have a look at an extension like https://extensions.xwiki.org/xwiki/bin/view/Extension/Admin%20Tools%20Application , at its “show rights” function, whose objective is exactly this, to show all the rights settings that are setup on a wiki, as an overview. Note, however, that this is a contributed extension , which has a different maintenance path than the standard XWiki project. It does, though, have an issue tracker, so if you find any bug with it, it would be great to report it.
Note: you’ll also need to verify the absence of rights objects before deleting the WebPreferences page, that class is XWiki.XWikiGlobalRights (and you may also want to check the same for XWiki.XWikiRights although you will very probably not find any this second one…)
Now I use two approaches combined.
The first one is an attempt of what @vmassol wrote:
#set ($webPreferences = $services.query.xwql("where doc.name like 'WebPreferences' and doc.author not like 'superadmin' order by upper(doc.fullName)").execute())
#foreach ($webPreference in $webPreferences)
#set ($document = $xwiki.getDocument($webPreference))
#set ($title = $document.fullName)
* [[$title>>$webPreference||target="_blank" queryString="editor=spaceadmin§ion=PageAndChildrenRights&space=Admin"]]
#end
The second one is this xwiki page I found because of @lucaa s words:
This page shows the pages with permissions that are actually set or were once set and not removed.
On the [[Overview page of all site administrations>>doc:XWiki.XWikiGlobalRights||queryString="livedata-config-classEntries=EYCQ7ghgYg0hICYDmEAuEXCA" target="_"]] "empty" site administrations that were once set can also to be deleted.
All "WebPreferences" can be seen here. This listing is not just about "page administration" but also about other preferences that have been set. In addition, imported, empty "page administrations" appear in this list, which do not appear in the overview page because there were never any entries for them in the database. These can only be deleted via the URL.
If the URL for site administration is ##wiki/ndr/admin/PATH/SEITE/WebPreferences##, then the "admin" in it must be replaced with a "delete": ##wiki/ndr/delete/PATH/SEITE /WebPreferences##.
There is an intermediate page that asks if you really want to delete.
{{velocity}}
## https://forum.xwiki.org/t/get-rid-of-empty-unused-page-administration/9774/4
## You’ll need to read the XWiki.XWikiPreferences xclass, iterate over all its xroperties metadata to find the xproperty field names.
## Then, with a query you can find all WebPreferences and for each you iterate over all the xproperty field names and if not empty or null then you display them.
## This is done so far:
#set ($webPreferences = $services.query.xwql("where doc.name like 'WebPreferences' and doc.author not like 'superadmin' order by upper(doc.fullName)").execute())
#foreach ($webPreference in $webPreferences)
#set ($document = $xwiki.getDocument($webPreference))
#set ($title = $document.fullName)
* [[$title>>$webPreference||target="_blank" queryString="editor=spaceadmin§ion=PageAndChildrenRights&space=Admin"]]
#end
{{/velocity}}