bigbluebutton-Github/bigbluebutton-html5/imports/api/whiteboard-multi-user/server/helpers.js
Pedro Beschorner Marin 381c5cb15c Isolated whiteboard access
Modified the previous implementation of the whiteboard individual access to remove
multiple Collections dependency on this feature. Multi-user whiteboard is now an
array instead of a boolean value and most of the access control can be synchronized
and handled by akka-apps.
2021-03-16 19:55:25 -03:00

32 lines
635 B
JavaScript

import Users from '/imports/api/users';
import WhiteboardMultiUser from '/imports/api/whiteboard-multi-user/';
const getMultiUser = (meetingId, whiteboardId) => {
const data = WhiteboardMultiUser.findOne(
{
meetingId,
whiteboardId,
}, { fields: { multiUser: 1 } },
);
if (!data || !data.multiUser || !Array.isArray(data.multiUser)) return [];
return data.multiUser;
};
const getUsers = (meetingId) => {
const data = Users.find(
{ meetingId },
{ fields: { userId: 1 } },
).fetch();
if (!data) return [];
return data.map(user => user.userId);
};
export {
getMultiUser,
getUsers,
};