Details
-
New Feature
-
Resolution: Unresolved
-
Major
-
None
-
7.2-milestone-3
-
None
-
Unknown
-
Description
There are a few places where we display the list of wikis:
- wiki index
- copy/rename UI
- document tree
- others?
Most of these places (probably all except the wiki index) don't filter the wikis the current user has access to. The wiki index does this:
## Restrict to the list of wiki I can see #set ($extra = "${extra} and doc.name IN (") #set ($separator = "") #foreach ($wiki in $services.wiki.getAll()) ## XWiki.XWikiComments is a mandatory document that it must exists and we should have acces to it #set ($testPageReference = $services.model.createDocumentReference($wiki.id, 'XWiki', 'XWikiComments')) #if ($xwiki.hasAccessLevel('view', $xcontext.user, $testPageReference) || ($services.wiki.user.getUserScope($wiki.id)!='LOCAL_ONLY' && $services.wiki.user.getMembershipType($wiki.id) != 'INVITE') || $services.wiki.user.hasPendingInvitation($xcontext.userReference, $wiki.id)) #set ($extra = "${extra}${separator}'XWikiServer${stringtool.capitalize($wiki.id)}'") #set ($separator = ",") #end #end #set ($extra = "${extra})")
but it's a lot of code to duplicate so we need this in a method in the wiki script service so that we can reuse it.