Can I hide the Members List of a Channel from selected Users?

Description

We want to hide the members list of a read only channel from users with restricted permissions (guest role).

Server Setup Information

  • Version of Rocket.Chat Server: 3.15.0
  • Operating System: Ubuntu
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v12.22.1
  • MongoDB Version: 3.6.14

Any additional Information

Agreed - you would think that should be a standard feature.

Yeah, I’m not sure how basic privacy settings are still not possible.

I stumbled across this issue myself the other day and came up with an easy javascript method to do so - it’s not perfect in terms of security, but works if you just want to hide the icon.

Just add this to “Custom Script for Logged In Users”:

var rcxAvatarCheckInterval = setInterval(function() {
    var rcxAvatar = document.querySelector('.rcx-avatar');
    if (rcxAvatar != 'none') {
      clearInterval(rcxAvatarCheckInterval);
      var username = rcxAvatar.getAttribute('aria-label');
      
      var membersList = document.querySelector('.rcx-icon--name-members').parentElement;
      
      if (username != 'markus') {
        membersList.style.display = 'none';
      } 
    }
}, 500);