bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/meetings/server/modifiers/changeLockSettings.js
Oleksandr Zhurbenko 9e1c8a4fb7 Permissions fix
Can't afford WebStorm :-(
2017-09-17 19:01:48 -07:00

40 lines
910 B
JavaScript

import Logger from '/imports/startup/server/logger';
import Meetings from '/imports/api/2.0/meetings';
import { check } from 'meteor/check';
export default function changeLockSettings(meetingId, payload) {
check(meetingId, String);
check(payload, {
disableCam: Boolean,
disableMic: Boolean,
disablePrivChat: Boolean,
disablePubChat: Boolean,
lockedLayout: Boolean,
lockOnJoin: Boolean,
lockOnJoinConfigurable: Boolean,
setBy: String,
});
const selector = {
meetingId,
};
const modifier = {
$set: {
lockSettingsProp: payload,
},
};
const cb = (err, numChanged) => {
if (err) {
return Logger.error(`Changing meeting={${meetingId}} lock settings: ${err}`);
}
if (numChanged) {
return Logger.error(`Changed meeting={${meetingId}} updated lock settings`);
}
};
return Meetings.upsert(selector, modifier, cb);
}