bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/slides/server/publishers.js
2017-06-30 15:16:00 -04:00

25 lines
728 B
JavaScript

import Slides from '/imports/api/2.0/slides';
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import mapToAcl from '/imports/startup/mapToAcl';
function slides(credentials) {
const { meetingId, requesterUserId, requesterToken } = credentials;
check(meetingId, String);
check(requesterUserId, String);
check(requesterToken, String);
Logger.info(`Publishing Slides for ${meetingId} ${requesterUserId} ${requesterToken}`);
return Slides.find({ meetingId });
}
function publish(...args) {
const boundSlides = slides.bind(this);
return mapToAcl('subscriptions.slides', boundSlides)(args);
}
Meteor.publish('slides2x', publish);