Wiki source code of Rights Listing
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | { {velocity} } | ||
2 | ## https://forum.xwiki.org/t/how-to-secure-users-profile-on-xwiki-with-public-space/5008/5 | ||
3 | |||
4 | #set($classsName=['XWiki.XWikiGlobalRights','XWiki.XWikiRights']) | ||
5 | |||
6 | {{html wiki='true'}} | ||
7 | <table id="tableid${velocityCount}" class="grid sortable filterable doOddEven"> | ||
8 | <tr class="sortHeader"> | ||
9 | <th>Location</th><th>Right</th><th style="min-width:9ch;">Allow</th><th>User/Group</th><th style="min-width:17ch;">Date</th> | ||
10 | </tr> | ||
11 | #foreach($className in $classsName) | ||
12 | #set($hql = "select distinct obj.name from BaseObject obj where obj.className='$className' order by obj.name") | ||
13 | #set($results = $xwiki.search($hql)) | ||
14 | #foreach ($Page in $results) | ||
15 | #set($MyDoc = $xwiki.getDocument("$Page")) | ||
16 | #set($class = $xwiki.getClass("$className")) | ||
17 | |||
18 | ## loop over all objects | ||
19 | #foreach($obj in $MyDoc.getObjects("$className")) | ||
20 | #set ($displayLocation="") | ||
21 | #set($discard = $MyDoc.use($obj)) | ||
22 | #set($rawLevel = $obj.getProperty('levels').value) | ||
23 | #set($rawAllow = $obj.getProperty('allow').value) | ||
24 | #set($rawUsers = $obj.getProperty('users').value) | ||
25 | #set($date = $MyDoc.date) | ||
26 | #set($date = $xwiki.formatDate($date, "yyyy-MM-dd HH:mm:ss")) | ||
27 | #if($rawUsers == "") | ||
28 | #set($rawUsers = $obj.getProperty('groups').value) | ||
29 | #end | ||
30 | ##if (($rawLevel.contains('view')) && ($rawUsers.contains('XWiki.XWikiGuest'))) | ||
31 | #set ($displayLocation='<tr><td>' + "[[$MyDoc>>$MyDoc.fullName]]" + '</td><td>' + $rawLevel + '</td><td>' + $rawAllow + '</td><td>' + [[$rawUsers]] + '</td><td>' + $date + '</td></tr>') | ||
32 | $!displayLocation | ||
33 | ##end | ||
34 | #end | ||
35 | #end | ||
36 | #end | ||
37 | </table> | ||
38 | {{/html}} | ||
39 | |||
40 | { {/velocity} } |