Files
codeocean/app/policies/programming_group_policy.rb
kiragrammel 79ce069f68 Add CRUD operations for Programming Groups
* Correct sorting in table
* Modify page when nested in exercises
* Fix links between pages
* Link from statistics page to programming_groups/index
* Link from submission page to programming_groups/<id>
* Allow filtering for exercise ID on ProgrammingGroup#index
* Add search fields for internal and external user id on pg/index
2023-10-23 18:17:42 +02:00

19 lines
358 B
Ruby

# frozen_string_literal: true
class ProgrammingGroupPolicy < AdminOnlyPolicy
def create?
everyone
end
def new?
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 if @record.blank?
admin? || author_in_programming_group?
end
end