Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Grant current-poll access to attendee presenter too #12907

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 14 additions & 13 deletions bigbluebutton-html5/imports/api/polls/server/publishers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@ function currentPoll() {

const { meetingId, userId } = tokenValidation;

const User = Users.findOne({ userId, meetingId }, { fields: { role: 1 } });
if (!User || User.role !== ROLE_MODERATOR) {
Logger.warn(
'Publishing current-poll was requested by non-moderator connection',
{ meetingId, userId, connectionId: this.connection.id },
);
return Polls.find({ meetingId: '' });
}
const User = Users.findOne({ userId, meetingId }, { fields: { role: 1, presenter: 1 } });

Logger.debug('Publishing Polls', { meetingId, userId });
if (!!User && (User.role === ROLE_MODERATOR || User.presenter)) {
Logger.debug('Publishing Polls', { meetingId, userId });

const selector = {
meetingId,
};
const selector = {
meetingId,
};

return Polls.find(selector);
}

return Polls.find(selector);
Logger.warn(
'Publishing current-poll was requested by non-moderator connection',
{ meetingId, userId, connectionId: this.connection.id },
);
return Polls.find({ meetingId: '' });
}

function publishCurrentPoll(...args) {
Expand Down