Hi, All!
I'm going to make this script running. It works only if user loading this page has
access to the W.WebPreferences page.
If he does not: Access denied in edit mode on document W.WebPreferences. Author of the
script's page is admin with programming rights.
Any idea how to read page with no access rights to it in velocity?
{{velocity}}
#set ($mydoc = $xwiki.getDocumentAsAuthor("W.WebPreferences"))
#set ($rightsObject = $mydoc.newObject("XWiki.XWikiGlobalRights"))
#set ($result1 = $rightsObject.set("groups",
"XWiki.XWikiAdminGroup"))
#set ($result2 = $rightsObject.set("levels", "view,comment,edit"))
#set ($result3 = $rightsObject.set("users", "$xcontext.getUser()"))
#set ($result4 = $rightsObject.set("allow", 1))
## $mydoc.saveAsAuthor()
{{velocity}}
Any help is appreciated.
Kind regards,
Dmitry