bigbluebutton-Github/bigbluebutton-html5/imports/api/external-videos/server/index.js

25 lines
628 B
JavaScript
Raw Normal View History

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');
2019-01-15 03:10:08 +08:00
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';
2019-01-15 03:10:08 +08:00
}
ExternalVideoStreamer.allowEmit(allowFromPresenter);