User room owners permission if current_user is nil for recording (#2854)

This commit is contained in:
Ahmad Farhat 2021-08-13 10:55:22 -04:00 committed by GitHub
parent 794734c6d6
commit fc06994d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -435,10 +435,11 @@ class RoomsController < ApplicationController
def record_meeting
# If the require consent setting is checked, then check the room setting, else, set to true
user = current_user || @room.owner
if recording_consent_required?
room_setting_with_config("recording") && current_user&.role&.get_permission("can_launch_recording")
room_setting_with_config("recording") && user&.role&.get_permission("can_launch_recording")
else
current_user&.role&.get_permission("can_launch_recording")
user&.role&.get_permission("can_launch_recording")
end
end