bigbluebutton-Github/bigbluebutton-html5/imports/api/cursor/server/publishers.js

23 lines
793 B
JavaScript
Raw Normal View History

2016-11-18 20:26:14 +08:00
import Cursor from '/imports/api/cursor';
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import { isAllowedTo } from '/imports/startup/server/userPermissions';
Meteor.publish('cursor', (credentials) => {
// TODO: Some publishers have ACL and others dont
// if (!isAllowedTo('@@@', credentials)) {
// this.error(new Meteor.Error(402, "The user was not authorized to subscribe for 'cursor'"));
// }
const { meetingId, requesterUserId, requesterToken } = credentials;
check(meetingId, String);
check(requesterUserId, String);
check(requesterToken, String);
2016-12-01 00:30:52 +08:00
Logger.debug(`Publishing Cursor for ${meetingId} ${requesterUserId} ${requesterToken}`);
2016-11-18 20:26:14 +08:00
return Cursor.find({ meetingId });
});