bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/meetings/server/modifiers/changeUserLock.js
2017-09-07 07:31:19 -07:00

27 lines
576 B
JavaScript

import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/2.0/users';
import { check } from 'meteor/check';
export default function changeUserLock(meetingId, payload) {
check(meetingId, String);
check(payload, Object)
const selector = {
userId: payload.userId,
};
const modifier = {
$set: {
locked: payload.locked,
},
};
const cb = (err) => {
if (err) {
return Logger.error(`Changing user lock setting: ${err}`);
}
};
return Users.upsert(selector, modifier, cb);
};