Files
codeocean/app/policies/programming_group_policy.rb
Sebastian Serth 1bd0cd9a56 Require programming group for streaming the editor
Potentially fixes CODEOCEAN-V2
2023-09-20 23:31:54 +02:00

19 lines
357 B
Ruby

# frozen_string_literal: true
class ProgrammingGroupPolicy < ApplicationPolicy
def new?
everyone
end
def create?
everyone
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