bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/logout-confirmation/service.js
2017-09-21 15:51:58 -03:00

25 lines
674 B
JavaScript

import { makeCall } from '/imports/ui/services/api/index';
import Users from '/imports/api/2.0/users';
import Breakouts from '/imports/api/2.0/breakouts';
import mapUser from '/imports/ui/services/user/mapUser';
import Auth from '/imports/ui/services/auth';
const endMeeting = () => {
makeCall('endMeeting', Auth.credentials);
};
const isModerator = () => {
const currentUserId = Auth.userID;
const currentUser = Users.findOne({ userId: currentUserId });
return (currentUser) ? mapUser(currentUser).isModerator : null;
};
const isBreakout = () => Breakouts.findOne({ breakoutId: Auth.meetingID });
export default {
endMeeting,
isModerator,
isBreakout,
};