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

The user DocumentReference resolver resolves the XWikiGuest user to a document reference instead of null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 4.0-milestone-2
    • Old Core
    • None
    • Unknown

    Description

      In the DocumentReference based APIs (AuthorizationManager, GroupManager, ...) the guest user is represented by null. The user DocumentReferenceResolver<String> (UserAndGroupDocumentReferenceResolver) follows this convention for a null value, but not for the value under which the guest user is stored in rights and group objects.

      STEPS TO REPRODUCE:

      • Resolve XWiki.XWikiGuest (or XWikiGuest) with the user DocumentReferenceResolver<String>

      EXPECTED RESULTS:

      • null, the guest user, like for a null value

      ACTUAL RESULTS:

      • the document reference xwiki:XWiki.XWikiGuest, which doesn't designate any actual user

      As a consequence, each code reading stored user values has to check the page name of the resolved reference itself, for example XWikiSecurityRule, which turns a resolved XWikiGuest user into null to match the guest user.

      Things to check

      • every caller of the user and group resolvers must support a null result for a non-null value: XWikiSecurityRule (via DefaultSecurityEntryReader), DefaultSecurityCacheRulesInvalidatorListener, WikiOwnerUpdater, DefaultWikiDescriptorBuilder, and extensions looking them up by hint
      • whether the group hint, served by the same component, should behave the same way
      • the matching (exact case, like XWikiSecurityRule and the authorization bridge, or case insensitive, like XWikiRightService#isGuest)

      Fixing it changes the behavior of an existing component, so it needs to be discussed on the forum first.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: