| Step to reproduce:
- Create a sub-wiki
- Call org.xwiki.contrib.authentication.internal.DefaultUserManager#addToGroup from the sub-wiki with a group on the main wiki and with a user reference which is in the main wiki.
Expected: As the group and the user are in the main wiki the reference stored would be something like XWiki.Userx. Currently: As the serializer have in the context the sub-wiki the user reference contains the wiki part and so it's stored like xwiki:XWiki.Userx. And even worse if the context changed, we can have the user duplicated because have the variant stored into the XWikiGroup object. |