Implements disabledFeatures=sharedNotes

This commit is contained in:
Gustavo Trott 2022-03-09 16:23:38 -03:00
parent 057b7514b1
commit 537704ef0e
5 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package org.bigbluebutton.core.apps.pads
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.PermissionCheck
import org.bigbluebutton.core.bus.MessageBus
import org.bigbluebutton.core.models.Pads
import org.bigbluebutton.core.running.LiveMeeting
@ -21,7 +22,11 @@ trait PadCreateSessionReqMsgHdlr {
bus.outGW.send(msgEvent)
}
if (Pads.hasAccess(liveMeeting, msg.body.externalId, msg.header.userId)) {
if (liveMeeting.props.meetingProp.disabledFeatures.contains("sharedNotes")) {
val meetingId = liveMeeting.props.meetingProp.intId
val reason = "Shared Notes disabled for this meeting."
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, bus.outGW, liveMeeting)
} else if (Pads.hasAccess(liveMeeting, msg.body.externalId, msg.header.userId)) {
Pads.getGroup(liveMeeting.pads, msg.body.externalId) match {
case Some(group) => broadcastEvent(group.groupId, msg.header.userId)
case _ =>

View File

@ -212,7 +212,9 @@ export default function addMeeting(meeting) {
if (insertedId) {
Logger.info(`Added meeting id=${meetingId}`);
initPads(meetingId);
if (newMeeting.meetingProp.disabledFeatures.indexOf('sharedNotes') === -1) {
initPads(meetingId);
}
initCaptions(meetingId);
} else if (numberAffected) {
Logger.info(`Upserted meeting id=${meetingId}`);

View File

@ -4,6 +4,7 @@ import PadsService from '/imports/ui/components/pads/service';
import Auth from '/imports/ui/services/auth';
import { Session } from 'meteor/session';
import { ACTIONS, PANELS } from '/imports/ui/components/layout/enums';
import { isSharedNotesEnabled } from '/imports/ui/services/features';
const NOTES_CONFIG = Meteor.settings.public.notes;
const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator;
@ -58,7 +59,7 @@ const hasUnreadNotes = (sidebarContentPanel) => {
return rev !== 0 && rev > lastRev;
};
const isEnabled = () => NOTES_CONFIG.enabled;
const isEnabled = () => isSharedNotesEnabled();
const toggleNotesPanel = (sidebarContentPanel, layoutContextDispatch) => {
layoutContextDispatch({

View File

@ -31,3 +31,7 @@ export function isExternalVideoEnabled() {
export function isChatEnabled() {
return getDisabledFeatures().indexOf('chat') === -1 && Meteor.settings.public.chat.enabled;
}
export function isSharedNotesEnabled() {
return getDisabledFeatures().indexOf('sharedNotes') === -1 && Meteor.settings.public.notes.enabled;
}

View File

@ -409,7 +409,7 @@ endWhenNoModerator=false
endWhenNoModeratorDelayInMinutes=1
# List of features to disable (comma-separated)
# Available options: chat, externalVideos, learningDashboard, polls, screenshare
# Available options: chat, externalVideos, learningDashboard, polls, screenshare, sharedNotes
#disabledFeatures=
# Allow endpoint with current BigBlueButton version