"if
you want to change global (wiki or space) rights, use
XWiki.XWikiGlobalRights". See the last comment on the page for an example.
Hope this helps,
Marius
On Mon, Jan 25, 2016 at 10:41 AM, gervwyk <gervwyk(a)gmail.com> wrote:
  Good day.
 I'm trying to write a java component to set rights to a space and the space
 children. Normally, the user would set this on the space when clicking on
 administer page>users and groups>Rights: page and children, where the user
 can set access rights for a group to effect the space and its children.
 I'm trying to achieve this with a java component and currently I'm
 attaching
 an XWikiRights object with the specified group and rights to the
 <space>.WebHome page. However, this only effects the one page and not the
 children, also view rights only leaves comment and page creating rights
 which is not desired. Am I understanding the rights objects wrong? How do I
 achieve this in Java, currently I have:
         XWikiDocument doc = xwiki.getDocument(docref, xcontext); //
 referance to the <space>.WebHome
         DocumentReference classdoc =
 createDocumentReference(xwikiName,"XWiki","XWikiRights",false);
         BaseObject DSErightsobj = doc.newXObject(classdoc, xcontext);
         DSErightsobj.set("groups", DSEname, xcontext);
         DSErightsobj.set("users", "", xcontext);
         DSErightsobj.set("levels", "view", xcontext); // space right
         DSErightsobj.set("allow", 1, xcontext);
         xwiki.saveDocument(doc, xcontext);
 --
 View this message in context:
http://xwiki.475771.n2.nabble.com/XWikiRights-for-groups-on-page-and-childr…
 Sent from the XWiki- Users mailing list archive at 
Nabble.com.
 _______________________________________________
 users mailing list
 users(a)xwiki.org
 
http://lists.xwiki.org/mailman/listinfo/users