Hi,
On Tue, May 17, 2016 at 8:11 PM, abtv <andreybutov(a)mail.ru> wrote:
<http://xwiki.475771.n2.nabble.com/file/n7599471/xwiki_problem.jpg>
I have the following problem: Exception in macro #handleDocumentTreeRequest
called at 13:xwiki:XWiki.DocumentTree[line 3, column 1 What rights I need
to
add? I set view,comment,edit,delete,script rights. I use the following
code:
XWikiContext context = contextProvider.get();
if (context != null) {
XWiki xwiki = context.getWiki();
DocumentReference dr = new DocumentReference("xwiki",
"XWiki", "XWikiPreferences");
XWikiDocument doc = xwiki.getDocument(dr, context);
BaseObject bo =
doc.getObject("XWiki.XWikiGlobalRights",
true, context);
bo.set("groups", "XWiki.XWikiAllGroup",
context);
bo.set("levels",
"view,comment,edit,delete,script",
context);
bo.set("users", "", context);
bo.set("allow", 1, context);
xwiki.saveDocument(doc, context);
}
Yes, this looks good. It seems you now have the answer to your initial
question.
I`m not sure I understand your second question and/or how is it related to
the delete right. You might want to start a new thread and explain the
issue better there if it`s not related.
Thanks,
Eduard
--
View this message in context:
http://xwiki.475771.n2.nabble.com/How-to-grant-Delete-Right-for-all-registe…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs