2018-04-06 03:59:26 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import { check } from 'meteor/check';
|
2018-04-10 11:57:24 +08:00
|
|
|
import PresentationPods from '/imports/api/presentation-pods';
|
2018-04-06 03:59:26 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
import mapToAcl from '/imports/startup/mapToAcl';
|
|
|
|
|
|
|
|
function presentationPods(credentials) {
|
|
|
|
const { meetingId, requesterUserId, requesterToken } = credentials;
|
|
|
|
|
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
|
|
|
check(requesterToken, String);
|
|
|
|
|
2018-04-10 11:57:24 +08:00
|
|
|
Logger.info(`Publishing presentation-pods for ${meetingId} ${requesterUserId} ${requesterToken}`);
|
2018-04-06 03:59:26 +08:00
|
|
|
|
|
|
|
return PresentationPods.find({ meetingId });
|
|
|
|
}
|
|
|
|
|
|
|
|
function publish(...args) {
|
|
|
|
const boundPresentationPods = presentationPods.bind(this);
|
2018-04-10 11:57:24 +08:00
|
|
|
return mapToAcl('subscriptions.presentation-pods', boundPresentationPods)(args);
|
2018-04-06 03:59:26 +08:00
|
|
|
}
|
|
|
|
|
2018-04-10 11:57:24 +08:00
|
|
|
Meteor.publish('presentation-pods', publish);
|