bigbluebutton-Github/bigbluebutton-html5/imports/api/breakouts/server/publishers.js
2017-05-31 14:54:43 -03:00

28 lines
564 B
JavaScript

import Breakouts from '/imports/api/breakouts';
import { Meteor } from 'meteor/meteor';
import mapToAcl from '/imports/startup/mapToAcl';
Meteor.publish('breakouts', function() {
breakouts = breakouts.bind(this);
return mapToAcl(breakouts,'breakouts')(arguments);
});
function breakouts(credentials) {
const {
meetingId,
requesterUserId,
} = credentials;
return Breakouts.find({
$or: [
{ breakoutMeetingId: meetingId },
{
users: {
$elemMatch: { userId: requesterUserId },
},
},
],
});
};