Guillaume Lerouge wrote:
How exactly are you adding the user to that group? If you create an XWikiGroups object, add it to the group document, then save it, you should use saveWithProgrammingRights() instead of save().
THis is from the NoAccess.WebHome page.
Here is the velocity code segment I am using to try and add a user to the TrainedUsersGroup group.
01 #if($completed_training == "true" or $xwiki.hasAdminRights()) 02 ## 03 ## Add the current user to the TrainedUsersGroup group 04 ## 05 #set($MyGroupDoc = $xwiki.getDocument("XWiki.TrainedUsersGroup")) 06 #if(!$MyGroupDoc.getObject("XWiki.XWikiGroups", "member", $fullName))
07 #set($GroupObj = $MyGroupDoc.newObject("XWiki.XWikiGroups")) 08 #set($AddingUser = 1) 09 $GroupObj.set("member", $fullName) 10 $MyGroupDoc.save() 11 #end 12 #end
To do so, you can go to .../xwiki/bin/edit/XWiki/TrainedUsersGroup?editor=rights and make sure that the "Edit" checkbox is ticked in the XWikiAllGroup line. This allows all users to modify that page, thus making them able to add themselves to the group.
Once I had made the modification, my "normal" user was able to add himself to the TrainedUsersGroup simply by going to the page.
Hope this helps,
Guillaume, stop confusing. Dean, as I said, replace the save() call with saveWithProgrammingRights(). 10 $MyGroupDoc.saveWithProgramminRights() -- Sergiu Dumitriu http://purl.org/net/sergiu/