documentTree macro doesn't work after adding Delete right by default

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

documentTree macro doesn't work after adding Delete right by default

abtv
I use the following code to grant Delete right by default (I execute this java code on xwiki start):

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);
                }

I have strange effect: while I do have Delete right by default, documentTree macro doesn't work, I see spinning circles. I also have the following message in the xwiki terminal:
Exception in macro #handleDocumentTreeRequest called at 13:xwiki:XWiki.DocumentTree[line 3, column 1



How to fix the problem?
Reply | Threaded
Open this post in threaded view
|

Re: documentTree macro doesn't work after adding Delete right by default

Marius Dumitru Florea
On Fri, May 20, 2016 at 8:42 AM, abtv <[hidden email]> wrote:

> I use the following code to grant Delete right by default (I execute this
> java code on xwiki start):
>
> 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);
>                 }
>
> I have strange effect: while I do have Delete right by default,
> documentTree
> macro doesn't work, I see spinning circles. I also have the following
> message in the xwiki terminal:
> Exception in macro #handleDocumentTreeRequest called at
> 13:xwiki:XWiki.DocumentTree[line 3, column 1
>
> <http://xwiki.475771.n2.nabble.com/file/n7599540/xwiki_problem.jpg>
>
>

> How to fix the problem?
>

Use the browser's developer tools (the Network tab usually) to see the
response for the HTTP request sent when you attempt to expand a tree node.
It should contain a stacktrace that will explain the problem.

Hope this helps,
Marius


>
>
>
> --
> View this message in context:
> http://xwiki.475771.n2.nabble.com/documentTree-macro-doesn-t-work-after-adding-Delete-right-by-default-tp7599540.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs