How to see all the permissions sets on the Xwiki?

Hello,

I’m using XWiki for the intranet of my company and I would like to have a document with all the permissions/rights given on each page/ section. Currently we are using an Excel sheet but it’s difficult to maintain, do you have any other solution ?

thank you in advance for your help.

I had the same problem as you and finally found this extension: https://extensions.xwiki.org/xwiki/bin/view/Extension/Admin%20Tools%20Application

When you run it, there’s a section called Show Rights which gives a complete overview of all permissions which have been set in your wiki. It’s not perfect, but it is much better than the default permission viewer IMO and I wish I’d found it sooner. Hope this helps!

We did a script for this.

This script 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}}

Here as snippet: https://snippets.xwiki.org/xwiki/bin/view/Extension/List%20all%20rights%20(XWikiRights%20and%20XWikiGlobalRights)/

@Simpel we appreciate this contribution and would be great if you could update the page with a License type from the existing list. I’m pretty sure the license you chose is not something official :slight_smile:

Thanks,
Alex

This license is indeed from the actual list and was confirmed as a GPL-compatible free software license by the Free Software Foundation as to read here: WTFPL - Wikipedia.

Regards, Simpel

Hello @Qua8zoh6
Thanks a lot for your reply it was exactly what I was looking for !
Have a good day :slight_smile:

1 Like