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/userChannels.js

27 lines
494 B

import { Meteor } from 'meteor/meteor';
import { hasPermission } from '../../app/authorization';
import { Subscriptions } from '../../app/models';
Meteor.publish('userChannels', function(userId) {
if (!this.userId) {
return this.ready();
}
if (hasPermission(this.userId, 'view-other-user-channels') !== true) {
return this.ready();
}
return Subscriptions.findByUserId(userId, {
fields: {
rid: 1,
name: 1,
t: 1,
u: 1,
},
sort: {
t: 1,
name: 1,
},
});
});