From 1bd0cd9a566189c04ee0e3a66c2752879e1c9090 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Wed, 20 Sep 2023 23:31:54 +0200 Subject: [PATCH] Require programming group for streaming the editor Potentially fixes CODEOCEAN-V2 --- app/policies/programming_group_policy.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/policies/programming_group_policy.rb b/app/policies/programming_group_policy.rb index 6ff95565..48414c16 100644 --- a/app/policies/programming_group_policy.rb +++ b/app/policies/programming_group_policy.rb @@ -10,6 +10,9 @@ class ProgrammingGroupPolicy < ApplicationPolicy end 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 + admin? || author_in_programming_group? end end