Further check for programming group and add custom logging
Fixes CODEOCEAN-V2
This commit is contained in:
@ -31,6 +31,8 @@ class SynchronizedEditorChannel < ApplicationCable::Channel
|
||||
def specific_channel
|
||||
reject unless ProgrammingGroupPolicy.new(current_user, programming_group).stream_sync_editor?
|
||||
"synchronized_editor_channel_group_#{programming_group.id}"
|
||||
rescue NoMethodError => e
|
||||
Sentry.capture_exception(e, extras: {current_user:, programming_group:, session_id: @session_id, identifier: @identifier})
|
||||
end
|
||||
|
||||
def programming_group
|
||||
|
@ -11,7 +11,7 @@ class ProgrammingGroupPolicy < ApplicationPolicy
|
||||
|
||||
def stream_sync_editor?
|
||||
# A programming group needs to exist for the user to be able to stream the synchronized editor.
|
||||
return false unless @record
|
||||
return false if @record.blank?
|
||||
|
||||
admin? || author_in_programming_group?
|
||||
end
|
||||
|
Reference in New Issue
Block a user