bigbluebutton-Github/bigbluebutton-html5/imports/api/external-videos/server/index.js
2019-01-16 10:41:09 -03:00

25 lines
628 B
JavaScript

import { Meteor } from 'meteor/meteor';
import ExternalVideoStreamer from '/imports/api/external-videos';
import Users from '/imports/api/users';
import Logger from '/imports/startup/server/logger';
import './methods';
ExternalVideoStreamer.allowRead('all');
ExternalVideoStreamer.allowWrite('all');
const allowFromPresenter = (eventName, {userId, meetingId}) => {
let user = Users.findOne({userId});
let ret = user && user.presenter;
Logger.debug('Auth userid:', userId, ' event: ', eventName, ' suc: ', ret);
return ret || eventName == 'viewerJoined';
}
ExternalVideoStreamer.allowEmit(allowFromPresenter);