2018-11-30 01:24:02 +08:00
|
|
|
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}) => {
|
2018-11-30 01:24:02 +08:00
|
|
|
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);
|