23 lines
778 B
JavaScript
23 lines
778 B
JavaScript
import WhiteboardMultiUser from '/imports/api/2.0/whiteboard-multi-user/';
|
|
import { Meteor } from 'meteor/meteor';
|
|
import { check } from 'meteor/check';
|
|
import Logger from '/imports/startup/server/logger';
|
|
import mapToAcl from '/imports/startup/mapToAcl';
|
|
|
|
function whiteboardMultiUser(credentials) {
|
|
const { meetingId, requesterUserId, requesterToken } = credentials;
|
|
|
|
check(meetingId, String);
|
|
|
|
Logger.info(`Publishing whiteboard-multi-user for ${meetingId} ${requesterUserId} ${requesterToken}`);
|
|
|
|
return WhiteboardMultiUser.find({ meetingId });
|
|
}
|
|
|
|
function publish(...args) {
|
|
const boundMultiUser = whiteboardMultiUser.bind(this);
|
|
return mapToAcl('subscriptions.whiteboard-multi-user', boundMultiUser)(args);
|
|
}
|
|
|
|
Meteor.publish('whiteboard-multi-user', publish);
|