bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/slides/server/publishers.js

25 lines
726 B
JavaScript
Raw Normal View History

2017-06-29 03:05:50 +08:00
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('slides', publish);