bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/methods/userLogout.js
2017-05-17 15:17:27 -04:00

21 lines
579 B
JavaScript
Executable File

import { Meteor } from 'meteor/meteor';
import { isAllowedTo } from '/imports/startup/server/userPermissions';
import Logger from '/imports/startup/server/logger';
import userLeaving from './userLeaving';
export default function userLogout(credentials) {
if (!isAllowedTo('logoutSelf', credentials)) {
throw new Meteor.Error('not-allowed', `You are not allowed to logoutSelf`);
}
const { requesterUserId } = credentials;
try {
userLeaving(credentials, requesterUserId);
}
catch(e) {
Logger.error(`Exception while executing userLeaving: ${e}`);
}
};