bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/breakouts/server/publishers.js
2017-06-26 15:00:28 -03:00

30 lines
634 B
JavaScript

import Breakouts from './../';
import { Meteor } from 'meteor/meteor';
import mapToAcl from '/imports/startup/mapToAcl';
function breakouts(credentials) {
const {
meetingId,
requesterUserId,
} = credentials;
return Breakouts.find({
$or: [
{ breakoutMeetingId: meetingId },
{
users: {
$elemMatch: { userId: requesterUserId },
},
},
],
});
}
function publish(...args) {
console.err("breakout2x publish");
const boundBreakouts = breakouts.bind(this);
return mapToAcl('subscriptions.breakouts', boundBreakouts)(args);
}
Meteor.publish('breakouts2x', publish);