Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-12541

We need a way to get the list of wikis the current user has access to

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Unresolved
    • Major
    • None
    • 7.2-milestone-3
    • Wiki
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: