Restore XWikiAllGroup

Last modified by Sergiu Dumitriu on 2021/03/18 11:28

groupFixes the XWikiAllGroup by synchronizing it with real users in the wiki
Developed by


0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents


Recreates the XWiki.XWikiAllGroup page with all existing users added to it. This can be useful for the case when you accidentally delete or overwrite XWikiAllGroup (such as when you do a XAR import and overwrite it by mistake).

Add the following in a document in the XWiki Syntax 2.1:

#set ($allGroupDoc = $xwiki.getDocument('XWiki.XWikiAllGroup'))
#foreach ($userDocName in $xwiki.searchDocuments(', BaseObject as obj where obj.className=''XWiki.XWikiUsers'' and'))
  #if (!$allGroupDoc.getObject('XWiki.XWikiGroups', 'member', $userDocName))
    #set ($member = $allGroupDoc.newObject('XWiki.XWikiGroups'))
    $!member.set('member', $userDocName)
   * Restoring user [[$userDocName]] in XWikiAllGroup
#if ("$!{request.confirm}" == '1')
 [[Confirm these changes?>>$doc||queryString="confirm=1"]]

Get Connected