Allow all teachers of the same study group to edit their exercises

This commit is contained in:
Sebastian Serth
2019-12-04 15:25:00 +01:00
parent 1270bc3684
commit ff95fcd8f2
2 changed files with 10 additions and 5 deletions

View File

@ -8,7 +8,7 @@ class ExercisePolicy < AdminOrAuthorPolicy
end
[:clone?, :destroy?, :edit?, :update?].each do |action|
define_method(action) { admin? || author? }
define_method(action) { admin? || teacher_in_study_group || author? }
end
[:implement?, :working_times?, :intervention?, :search?, :submit?, :reload?].each do |action|