Introduce a System user for automatic changes

Hi devs,

Today, changes that nobody made by hand are attributed either to the last person who edited the page (e.g. when a page is updated by an initializer, a migration or a background listener, since XWiki#saveDocument doesn’t set an author) or to superadmin (pages created by the platform or installed by the Distribution Wizard). Users see in their history and notifications changes they never made, “superadmin” means nothing to them, and the actions of an admin using the superadmin account can’t be told apart from automatic changes.

This has been discussed several times (2009, 2015, 2016, 2017) without a decision on a dedicated user. Since 14.0 we have the original metadata author (displayed) separate from the effective metadata author (rights), which makes it possible now without touching rights.

I’ve written the full design here: https://design.xwiki.org/xwiki/bin/view/Proposal/SystemUser

Summary:

  • A virtual System user (SystemUserReference, reserved name XWikiSystem, stored as XWiki.XWikiSystem): no user page, can’t log in, holds no rights. The name is reserved in all user creation paths.
  • Only ever the original metadata author, never the effective or content author. The authorization manager denies it every right, unconditionally. No code runs as it.
  • Superadmin goes back to being the recovery account: only what a human does while logged in as superadmin is attributed to it.
  • Automatic change = a change no human asked for (initializers, migrations, background listeners/stores, Distribution Wizard and wiki creation installs, extensions’ background processing). A side effect of an action a human asked for (e.g. backlinks updated on rename) stays attributed to that human. Extensions installed/upgraded by a user from the EM are unchanged (Thomas has a separate proposal about the user the DW/EM run with; not mixed here).
  • For a page created automatically: original author and creator = System, effective and content author = superadmin as today (no change in rights). For an update: only the original author changes.
  • Display: a translated “System”, no link, a dedicated icon (and dedicated icons for superadmin and Guest too, UI by the UI/UX team). The “last author” livetable / Live Data column and a few templates switch from the effective to the original author, like the page header and history already do.
  • Notifications: the “hide system changes” filter hides System and, during a transition with no end date for now, superadmin too (configurable), with a deprecation warning to find extensions still saving as superadmin.
  • API: SystemUserReference.INSTANCE + one Java helper; a read-only $services.user.systemUserReference, no script API to save as System.
  • No data migration: existing history keeps its authors.

It’s compatible with, and independent from, Michael’s proposal to deprecate the effective metadata author.

The design page has the details, the implementation phases and the open questions.

The first phase is independent from the System user (it also fixes existing inconsistencies) and I’ve already filed it:

WDYT?

Here’s my +1

Thanks

PS: This post was co-written with Claude Code.

+1 for the concept in general

I think we should choose something which makes a bit more obvious that it’s a special user (and incidentally make it less conflict prone I guess). I can think of the following possibilities (or a combination of them):

  • not use the same space as other users (like User.Virtual.System, or XWiki.User.Virtual.System to keep it in a protected parent space)
  • keep the same space but use an unlikely syntax (like XWiki._xwikisystem)

I felt that the XWiki namespace prefix is already a good protection. It’s also consistent with XWikiGuest as mentioned in the proposal on the design page:

  • Reserved name XWikiSystem, stored as XWiki.XWikiSystem (same convention as XWikiGuest, in the XWiki* names already reserved by the platform).

It would also be mentioned in the RNs + prevented from being able to be created.

On my side, I prefer that name vs the other options proposed.

+1 for adding and start using this “display only” user

Thanks!

I would be very much +1 about it, except that I likely will not find much time to support the implementation, so it is more like a +0

I often get reports by users that some pages were modified / created by the “XWikiGuest” user, or that users have updates e.g. their profile page without having logged in - all causes by “automatic” updates or system processes. It takes some effort to tell them that this is “normal” behavior, and I guess they still feel somewhat uneasy that XWiki does something “behind their back” in their names.

I feel this is a very useful addition, at least from a user’s point of view.