-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add access code for public recordings #6064
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
base: master
Are you sure you want to change the base?
Add access code for public recordings #6064
Conversation
5a1acba to
d6dd1cc
Compare
fafbe31 to
40c676d
Compare
|
|
Related: #6136 |
|
| if option.nil? && is_access_code | ||
| option = RoomMeetingOption.create!( | ||
| room_id: @room.id, | ||
| meeting_option_id: MeetingOption.find_by(name: name).id, | ||
| value: value | ||
| ) | ||
| return render_data status: :ok | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its better to do this in a data migration
| recordings_access_code = RoomMeetingOption.joins(:meeting_option) | ||
| .where(room_id: @room.id, meeting_options: { name: 'glRecordingsAccessCode' }) | ||
| .first&.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to get the value using the RoomSettingsGetter (similar to this)
viewer_code = RoomSettingsGetter.new(
room_id: @room.id,
provider: @room.user.provider,
current_user: @current_user,
show_codes: true,
settings: 'glViewerAccessCode'
).call
|
|
||
| # If a recordings access code exists and the provided code doesn't match, require access code | ||
| if recordings_access_code.present? && params[:access_code] != recordings_access_code | ||
| return render_data data: [], meta: { requires_access_code: true }, status: :ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather we return something like this instead
return render_error status: :forbidden
| pagy, recordings = pagy(@room.public_recordings.order(sort_config, recorded_at: :desc).public_search(params[:search])) | ||
|
|
||
| render_data data: recordings, meta: pagy_metadata(pagy), serializer: PublicRecordingSerializer, status: :ok | ||
| render_data data: recordings, meta: pagy_metadata(pagy).merge(requires_access_code: false), serializer: PublicRecordingSerializer, status: :ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure what this is doing, but it shouldn't be doing it
| {publicRoom?.data.name} | ||
| </h1> | ||
| { (recordValue !== 'false') && recordings?.data?.length > 0 && ( | ||
| { (recordValue !== 'false') && (recordings?.data?.length > 0 || recordings?.meta?.requires_access_code === true) && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - I would look at how the viewer access code works and implement something similar



This pull request adds support for protecting public recordings with a dedicated access code.
Here is my first request to this feature:
#6043
Feature Demo
Below is a short demonstration of the new functionality in action:
What this adds
This improves security and flexibility for sharing content with external audiences.