2016-04-28 05:04:15 +08:00
|
|
|
import { isAllowedTo } from '/server/user_permissions';
|
2016-04-28 05:36:22 +08:00
|
|
|
import { requestUserLeaving } from '/server/collection_methods/users';
|
2016-04-29 05:37:15 +08:00
|
|
|
import { logger } from '/server/server.js';
|
2016-04-28 05:04:15 +08:00
|
|
|
|
2016-04-20 01:43:31 +08:00
|
|
|
Meteor.methods({
|
|
|
|
// meetingId: the meeting where the user is
|
|
|
|
// userId: the userid of the user logging out
|
|
|
|
// authToken: the authToken of the user
|
|
|
|
userLogout(meetingId, userId, authToken) {
|
|
|
|
if (isAllowedTo('logoutSelf', meetingId, userId, authToken)) {
|
2016-04-29 05:37:15 +08:00
|
|
|
logger.info(`a user is logging out from ${meetingId}:${userId}`);
|
2016-04-20 01:43:31 +08:00
|
|
|
return requestUserLeaving(meetingId, userId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|