ca09b69555
* Acl: Add check to undefined role Lint to eslint Missing merge file Fix lint problems Change Acl lookup Change ACL to be more extensible Fix a few review comments Acl refactor working Mostly working, still problems with user subs Code refactored
28 lines
749 B
JavaScript
28 lines
749 B
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
import { check } from 'meteor/check';
|
|
import Meetings from '/imports/api/1.1/meetings';
|
|
import Logger from '/imports/startup/server/logger';
|
|
import mapToAcl from '/imports/startup/mapToAcl';
|
|
|
|
function meetings(credentials) {
|
|
const { meetingId, requesterUserId, requesterToken } = credentials;
|
|
|
|
check(meetingId, String);
|
|
check(requesterUserId, String);
|
|
check(requesterToken, String);
|
|
|
|
Logger.info(`Publishing meeting=${meetingId} ${requesterUserId} ${requesterToken}`);
|
|
|
|
return Meetings.find({
|
|
meetingId,
|
|
});
|
|
}
|
|
|
|
function publish(...args) {
|
|
const boundMeetings = meetings.bind(this);
|
|
return mapToAcl('subscriptions.meetings', boundMeetings)(args);
|
|
}
|
|
|
|
Meteor.publish('meetings', publish);
|
|
|