Skip to content

Commit

Permalink
All users join moderator no longer allowing anyone to start meeting (b…
Browse files Browse the repository at this point in the history
…igbluebutton#5740)

* if glAnyoneJoinAsModerator is true it doesn't allow anyone joining to start meeting anymore

* rubocop fix

* fixed minor rubocop offense

* added check for shared users to start meeting

* Update meetings_controller.rb

* Update meetings_controller.rb

---------

Co-authored-by: Ahmad Farhat <[email protected]>
  • Loading branch information
SilentFlameCR and farhatahmad authored Mar 12, 2024
1 parent 2a20147 commit d695a8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/api/v1/meetings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def status
}

# Starts meeting if meeting is not running and glAnyoneCanStart is enabled or user is a moderator
if !data[:status] && authorized_to_start_meeting?(settings, bbb_role)
if !data[:status] && authorized_to_start_meeting?(settings)
begin
MeetingStarter.new(room: @room, base_url: request.base_url, current_user:, provider: current_provider).call
rescue BigBlueButton::BigBlueButtonException => e
Expand Down Expand Up @@ -123,8 +123,8 @@ def authorized_as_moderator?(mod_code:, viewer_code:, anyone_join_as_mod:)
(anyone_join_as_mod && (access_code_validator(access_code: mod_code) || access_code_validator(access_code: viewer_code)))
end

def authorized_to_start_meeting?(settings, bbb_role)
settings['glAnyoneCanStart'] == 'true' || bbb_role == 'Moderator'
def authorized_to_start_meeting?(settings)
settings['glAnyoneCanStart'] == 'true' || @room.user_id == current_user&.id || current_user&.shared_rooms&.include?(@room)
end

def unauthorized_access?(settings)
Expand Down

0 comments on commit d695a8c

Please sign in to comment.