bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/screenshare/server/publishers.js
2017-07-14 09:32:15 -03:00

24 lines
709 B
JavaScript

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