grinko wrote:
> Hello folks,
>
> I have some troubles setting space rights from Velocity and can't find any
> examples for it.
>
> This code should generate new XWikiGlobalRights objects for each user.
> However, adding them to the Space.WebHome page doesn't work, and adding them
> to the Space.WebPreferences page (like the Set Rights page does) fails (the
> objects are not generated).
>
> Can someone give me a hint whats wrong here?
>
> #foreach($newuser in $projectuserlist)
> #set ($myspace = $xwiki.getDocument("${projectname}.WebPreferences"))
> #set ($rightsObject = $myspace.newObject("XWiki.XWikiGlobalRights"))
> #set ($result = $rightsObject.set("levels", "view,edit"))
> #set ($result = $rightsObject.set("users", $newuser))
> ##set ($result = $rightsObject.set("allow", 1))
> $mydoc.save()
Who is $mydoc? :)
Try $myspace.save(), and it should work just fine.
> #end
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users