Wiki source code of Support Thousands of Users

Last modified by superadmin on 2026/11/25 21:35

Hide last authors
Eleni Cojocariu 3.1 1 After this change the group still grants its rights, but it no longer lists its members.
2
3 1. Open ##xwiki/WEB-INF/xwiki.cfg## in the wiki's web application and turn on the implicit all group. The line is shipped commented out at its default of ##0##.(((
4 {{code language="none"}}
5 #-# Should all users be considered members of XWiki.XWikiAllGroup, even if they don't have an
6 #-# associated object in the group's document?
7 xwiki.authentication.group.allgroupimplicit=1
8 {{/code}}
9 )))
10 1. Check ##xwiki.users.initialGroups## in the same file, a few lines above. It must **not** name ##XWiki.XWikiAllGroup##: a new account that is added to the group explicitly writes back the very object this page is removing, one registration at a time. Leaving the line commented out is the right answer, because XWiki then derives the default from the setting above and adds a new account to no group page at all.(((
11 {{code language="none"}}
12 #-# The default list depends on the value of xwiki.authentication.group.allgroupimplicit:
13 #-# 0: created users are added to XWiki.XWikiAllGroup group page
14 #-# 1: created users are not added to any group page (but they will virtually be part of
15 #-# XWiki.XWikiAllGroup group)
16 # xwiki.users.initialGroups=XWiki.XWikiAllGroup
17 {{/code}}
18 )))
19 1. Restart the servlet container. ##xwiki.cfg## is read once at startup, so nothing changes until the wiki comes back up.(((
20 {{code language="bash"}}
21 systemctl restart tomcat10
22 {{/code}}
23 )))
24 1. Remove the member objects from ##XWiki.XWikiAllGroup##. A handful can be removed from the group's administration screen, where each member row carries a **Remove** action; thousands cannot, so run the script below as a user with programming rights, on a page you then delete. It reports how many objects it removed.(((
25 {{warning}}
26 Remove the **objects**, never the page. ##XWiki.XWikiAllGroup## must keep existing: rights cannot be granted to a group whose page is gone, so deleting it silently drops every permission the wiki gives through it. Back the page up with an [[export>>doc:documentation.xs.admin.exports.WebHome]] before running anything that writes to it.
27 {{/warning}}
28
29 {{code language="groovy"}}
30 {{groovy}}
31 def group = xwiki.getDocument('XWiki.XWikiAllGroup')
32 def count = group.getObjects('XWiki.XWikiGroups').size()
33 group.removeObjects('XWiki.XWikiGroups')
34 group.save('Removed the member objects: the all group is now implicit')
35 println "Removed ${count} member objects"
36 {{/groovy}}
37 {{/code}}
38 )))
39 1. Open the group and check that it has no members left while the rights it grants still apply. The member list is empty, and a user who is in no other group can still do whatever ##XWikiAllGroup## is allowed to do.(((
40 {{image reference="allgroup-members.png" size="large" alt="The XWikiAllGroup administration screen with an empty member list after the member objects were removed"/}}
41 )))

Get Connected