bigbluebutton-Github/bigbluebutton-html5/imports/api/polls/server/publishers.js
2017-06-01 10:12:11 -03:00

29 lines
685 B
JavaScript
Executable File

import { Meteor } from 'meteor/meteor';
import Polls from '/imports/api/polls';
import { check } from 'meteor/check';
import { logger } from '/imports/startup/server/logger';
import mapToAcl from '/imports/startup/mapToAcl';
Meteor.publish('polls', function() {
polls = polls.bind(this);
return mapToAcl('polls', polls)(arguments);
});
function polls(credentials) {
const { meetingId, requesterUserId, requesterToken } = credentials;
check(meetingId, String);
check(requesterUserId, String);
check(requesterToken, String);
const selector = {
meetingId: meetingId,
users: requesterUserId,
};
let options = {};
return Polls.find(selector, options);
};