History and attachments: Accessibility

Hello!

I would like to ask if there is a way to make “History” and “Attachments” accessible only to a specific group of users?

For the time being I have removed them from my wiki but me as an admin user and some other trainers who also have lots of editing rights need to view them, whereas our trainees do not need to see the “History” or the “Attachments”.

Is there a way to semi/hide them ? :slight_smile:
Konstantina

Hi. This is not possible OOB but as with everything with XWiki, it’s possible to do it.

You’d need to edit or override in a skin, the following file: shortcuts.vm

For example in it you’ll see:

  #if($viewer != 'attachments' && $showattachments && !$doc.isNew())
    #set ($discard = $docextralinks.add(['attachments', $services.localization.render('docextra.attachments'), $doc.getAttachmentList().size(), 'attach', '', 'tmAttachments']))
  #end
  #if($viewer != 'history' && $showhistory && !$doc.isNew())
    #set ($discard = $docextralinks.add(['history', $services.localization.render('docextra.history'), -1, 'time', '', 'tmHistory']))
  #end

You’d need to add a new condition to the ifs to test for group belonging.

1 Like