How can I copy automatically the rights, set on a
page, to another page?
something like
#set($sourceDoc=$xwiki.getDocument("YourSpace.YourSourceDoc"))
#set($targetDoc=$xwiki.getDocument("YourSpace.YourTargetDoc"))
#foreach($right in $sourceDoc.getObjects("XWiki.XWikiRights"))
#set($entry=$targetDoc.newObject("XWiki.XWikiRights"))
$entry.set("groups",$right.get("groups"))
$entry.set("userss",$right.get("users"))
$entry.set("levels",$right.get("level"))
$entry.set("allow",$right.get("allow"))
#end
## Here same loop replacing XWiki.XWikiRights by XWiki.XWikiGlobalRights
$targetDoc.save()
(not tested)
Regards,
Jerome.
Thanks
raffo
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users