List all rights (XWikiRights and XWikiGlobalRights)

Last modified by Simpel on 2026/06/02 17:54

cogThis page lists all existing 'XWiki.XWikiRights' and 'XWiki.XWikiGlobalRights'. Each of these objects has an account/group, the type of right and whether it is permitted or prohibited. In addition, the last modification date is displayed.
Type
CategoryOther
Developed by

Simpel

Rating
0 Votes
LicenseDo What The Fuck You Want To Public License 2

Table of contents

Description

This page lists all existing 'XWiki.XWikiRights' and 'XWiki.XWikiGlobalRights'. Each of these objects has an account/group, the type of right and whether it is permitted or prohibited. In addition, the last modification date is displayed.

This page lists all existing '[[XWiki.XWikiRights>>XWiki.XWikiRights]]' and '[[XWiki.XWikiGlobalRights>>XWiki.XWikiGlobalRights]]'. Each of these objects has an account/group, the type of right and whether it is permitted or prohibited. In addition, the last modification date is displayed.

{{velocity}}
## https://forum.xwiki.org/t/how-to-secure-users-profile-on-xwiki-with-public-space/5008/5

#set($classsName=['XWiki.XWikiGlobalRights','XWiki.XWikiRights'])

{{html wiki='true'}}
<table id="tableid${velocityCount}" class="grid sortable filterable doOddEven">
  <tr class="sortHeader">
    <th>Location</th><th>Right</th><th style="min-width:9ch;">Allow</th><th>User/Group</th><th style="min-width:17ch;">Date</th>
  </tr>
#foreach($className in $classsName)
#set($hql = "select distinct obj.name from BaseObject obj where obj.className='$className' order by obj.name")
#set($results = $xwiki.search($hql))
#foreach ($Page in $results)
  #set($MyDoc = $xwiki.getDocument("$Page"))
  #set($class = $xwiki.getClass("$className"))

  ## loop over all objects
  #foreach($obj in $MyDoc.getObjects("$className"))
   #set ($displayLocation="")
    #set($discard = $MyDoc.use($obj))
    #set($rawLevel = $obj.getProperty('levels').value)
    #set($rawAllow = $obj.getProperty('allow').value)
    #set($rawUsers = $obj.getProperty('users').value)
    #set($date = $MyDoc.date)
    #set($date = $xwiki.formatDate($date, "yyyy-MM-dd HH:mm:ss"))
    #if($rawUsers == "")
      #set($rawUsers = $obj.getProperty('groups').value)
    #end
    ##if (($rawLevel.contains('view')) && ($rawUsers.contains('XWiki.XWikiGuest')))
      #set ($displayLocation='<tr><td>' + "[[$MyDoc>>$MyDoc.fullName]]" + '</td><td>' + $rawLevel + '</td><td>' + $rawAllow + '</td><td>' + [[$rawUsers]] + '</td><td>' + $date + '</td></tr>')
      $!displayLocation
    ##end
  #end
#end
#end
</table>
{{/html}}

{{/velocity}}

Get Connected