The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/publications/roomSubscriptionsByRole.js

21 lines
397 B

Meteor.publish('roomSubscriptionsByRole', function(rid, role) {
if (!this.userId) {
return this.ready();
}
if (RocketChat.authz.hasPermission(this.userId, 'view-other-user-channels') !== true) {
return this.ready();
}
return RocketChat.models.Subscriptions.findByRoomIdAndRoles(rid, role, {
fields: {
rid: 1,
name: 1,
roles: 1,
u: 1
},
sort: {
name: 1
}
});
});