• sharan mudgal
    sharan mudgal, 2008/10/24 03:29

    How to get the space object to set the permission on a space. Could you please give the equivalent of the 1st line in the snippet above

    • Valdis Vitolins
      Valdis Vitolins, 2013/12/29 21:10

      To set permissions for wiki or space you need to add XWiki.XWikiGlobalRights object for WebPreferences page. Something like:

      #set ($mydoc = $xwiki.getDocument("Space.WebPreferences"))
      #set ($rightsObject = $mydoc.getObject("XWiki.XWikiGlobalRights", true))
      ## Set the values of the fields
      #set ($result = $rightsObject.set("groups", "XWiki.XWikiAdminGroup"))
      #set ($result = $rightsObject.set("levels", "edit"))
      #set ($result = $rightsObject.set("users", ""))
      #set ($result = $rightsObject.set("allow", 1))
      ...
  • Camille Desmots
    Camille Desmots, 2019/01/30 15:03

    This will set the properties for a local group (local mean with scope in the wiki).
    How to do if you want to set properties for a global group ?
    (Like when you are on the panel "Wiki Administration: Rights" and you select "Search Scope = Global")  

    Thanks.

Get Connected