From a33fa06f091412d245f337864bfac0e66870638a Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Wed, 17 Mar 2021 17:21:34 -0400 Subject: [PATCH] Moved moderator access setting to Room Configuration (#2579) --- app/controllers/application_controller.rb | 2 +- .../admins/components/_room_settings.html.erb | 21 +++++++++++++++++++ .../site_settings/_settings.html.erb | 21 ------------------- config/application.rb | 2 +- config/locales/de_DE.yml | 10 --------- config/locales/en.yml | 8 +++---- spec/controllers/rooms_controller_spec.rb | 12 +++++++---- 7 files changed, 34 insertions(+), 42 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 75ac36f0..cfdd66c8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -188,7 +188,7 @@ class ApplicationController < ActionController::Base # Indicates whether users are allowed to add moderator access codes to rooms def moderator_code_allowed? - @settings.get_value("Moderator Access Codes") == "true" + @settings.get_value("Room Configuration Moderator Access Codes") == "optional" end helper_method :moderator_code_allowed? diff --git a/app/views/admins/components/_room_settings.html.erb b/app/views/admins/components/_room_settings.html.erb index 53d37046..d81e4606 100644 --- a/app/views/admins/components/_room_settings.html.erb +++ b/app/views/admins/components/_room_settings.html.erb @@ -124,5 +124,26 @@ <% end %> +
+
+
+ + + +
+
+
diff --git a/app/views/admins/components/site_settings/_settings.html.erb b/app/views/admins/components/site_settings/_settings.html.erb index fa4cf6eb..464d3088 100644 --- a/app/views/admins/components/site_settings/_settings.html.erb +++ b/app/views/admins/components/site_settings/_settings.html.erb @@ -143,27 +143,6 @@ -
-
-
- - - -
-
-
diff --git a/config/application.rb b/config/application.rb index bed9f47c..3670e7c6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -176,7 +176,7 @@ module Greenlight config.preupload_presentation_default = "false" # Don't show option to generate moderator access codes - config.moderator_codes_default = "false" + config.moderator_codes_default = "disabled" # Default admin password config.admin_password_default = ENV['ADMIN_PASSWORD'] || 'administrator' diff --git a/config/locales/de_DE.yml b/config/locales/de_DE.yml index a08504fb..fbcc77e9 100644 --- a/config/locales/de_DE.yml +++ b/config/locales/de_DE.yml @@ -105,11 +105,6 @@ de_DE: approval: Zulassen/Ablehnen invite: Teilnahme durch Einladung open: Offene Registrierung - moderator_codes: - info: "Mit gültigen Moderatorencodes können Nutzerinnen einem Raum als Moderator beitreten, ohne sich vorher einen Account anzulegen und einzeln Zugriff zu erhalten. Die Einstellung kann für jeden Raum seperat getätigt werden." - title: Ermöglicht die Erstellung von Moderatorencodes - enabled: Aktiviert - disabled: Deaktiviert rooms: info: "Limitiert die Anzahl der Räume, die Nutzer einrichten können (inklusive des Startraums). Diese Einstellung wirkt sich nicht auf Administratoren aus." title: Anzahl der Räume pro Nutzer @@ -395,9 +390,7 @@ de_DE: title: Neue Rolle erstellen create_room: access_code: Zugangscode - moderator_access_code: Moderatorencode access_code_placeholder: Generieren eines optionalen Raumzugangscodes - moderator_access_code_placeholder: Generieren eines optionalen Moderatorencodes auto_join: Automatisch dem Raum beitreten create: Raum erstellen free_delete: Sie können den Raum jederzeit wieder löschen. @@ -550,7 +543,6 @@ de_DE: access_code_required: "Bitte geben Sie einen gültigen Zugangscode ein, um den Raum zu betreten" add_presentation: Präsentation hinzufügen copy_access: Zugangscode kopieren - copy_moderator_access: Moderatorcode kopieren create_room: Raum erstellen create_room_error: Bei der Erstellung des Raums ist ein Fehler aufgetreten create_room_success: Raum erfolgreich erstellt @@ -559,8 +551,6 @@ de_DE: success: Raum erfolgreich gelöscht fail: "Raum konnte nicht gelöscht werden (%{error})" enter_the_access_code: Raumzugangscode bitte eingeben - enter_the_moderator_access_code: "Moderatorencode bitte eingeben!" - optional_moderator_access_code: "Optionaler Moderatorencode:" invalid_provider: "Sie haben eine ungültige URL eingegeben, bitte überprüfen Sie die URL und versuchen Sie es erneut." invitation_description: "Sie wurden zu %{name} über BigBlueButton zur Teilnahme eingeladen. Um beizutreten, klicken Sie auf den obigen Link und geben Sie Ihren Namen ein." invited: Sie wurden zur Teilnahme eingeladen diff --git a/config/locales/en.yml b/config/locales/en.yml index 673c6f31..c06948d8 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -111,11 +111,6 @@ en: shared_access: info: Setting to disabled will remove the button from the Room options dropdown, preventing users from sharing rooms title: Allow Users to Share Rooms - moderator_codes: - info: "With valid moderator codes, users can join a room as a moderator without having to create an account and receive access individually. The setting can be made separately for each room." - title: Enables the generation of moderator codes - enabled: Enabled - disabled: Disabled subtitle: Customize Greenlight tabs: appearance: Appearance @@ -180,6 +175,9 @@ en: info: Gives all users moderator privileges in BigBlueButton when they join the meeting. recordings: info: Allows room owners to specify whether they want the option to record a room or not. If enabled, the moderator must still click the "Record" button once the meeting has started. + moderator_codes: + info: Allows room owners to optionally generate a moderator pin which allows other users to join directly as moderators. + title: Enables the generation of moderator codes options: disabled: Disabled enabled: Always Enabled diff --git a/spec/controllers/rooms_controller_spec.rb b/spec/controllers/rooms_controller_spec.rb index 34063a44..4733cd49 100644 --- a/spec/controllers/rooms_controller_spec.rb +++ b/spec/controllers/rooms_controller_spec.rb @@ -276,7 +276,8 @@ describe RoomsController, type: :controller do it "should use join name if user is not logged in and meeting running and moderator access code is enabled and set" do allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(true) allow_any_instance_of(Setting).to receive(:get_value).and_call_original - allow_any_instance_of(Setting).to receive(:get_value).with("Moderator Access Codes").and_return("true") + allow_any_instance_of(Setting).to receive(:get_value) + .with("Room Configuration Moderator Access Codes").and_return("optional") room = Room.new(name: "test", moderator_access_code: "abcdef") room.room_settings = "{ }" @@ -416,7 +417,8 @@ describe RoomsController, type: :controller do it "should join the room as moderator if the user has the moderator_access code (and regular access code is not set)" do allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(true) allow_any_instance_of(Setting).to receive(:get_value).and_call_original - allow_any_instance_of(Setting).to receive(:get_value).with("Moderator Access Codes").and_return("true") + allow_any_instance_of(Setting).to receive(:get_value) + .with("Room Configuration Moderator Access Codes").and_return("optional") room = Room.new(name: "test", moderator_access_code: "abcdef") room.room_settings = "{ }" @@ -431,7 +433,8 @@ describe RoomsController, type: :controller do it "should join the room as moderator if the user has the moderator_access code (and regular access code is set)" do allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(true) allow_any_instance_of(Setting).to receive(:get_value).and_call_original - allow_any_instance_of(Setting).to receive(:get_value).with("Moderator Access Codes").and_return("true") + allow_any_instance_of(Setting).to receive(:get_value) + .with("Room Configuration Moderator Access Codes").and_return("optional") room = Room.new(name: "test", access_code: "123456", moderator_access_code: "abcdef") room.room_settings = "{ }" @@ -744,7 +747,8 @@ describe RoomsController, type: :controller do it "should redirect to show with valid moderator_access_code as regular access_code" do allow_any_instance_of(Setting).to receive(:get_value).and_call_original - allow_any_instance_of(Setting).to receive(:get_value).with("Moderator Access Codes").and_return("true") + allow_any_instance_of(Setting).to receive(:get_value) + .with("Room Configuration Moderator Access Codes").and_return("optional") @room.moderator_access_code = "abcdef" @room.save