bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/meetings/server/modifiers/changeUserLock.js

31 lines
643 B
JavaScript
Raw Normal View History

2017-09-07 03:53:07 +08:00
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, {
userId: String,
locked: Boolean,
lockedBy: String,
});
2017-09-07 03:53:07 +08:00
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);
2017-09-08 01:38:00 +08:00
};