Add Request for Comments view per exercise, adopt policies for teachers

This commit is contained in:
Sebastian Serth
2019-11-29 15:28:06 +01:00
parent 9dfe6b4529
commit ab96fb92c2
6 changed files with 19 additions and 3 deletions

View File

@ -3,11 +3,11 @@ class ExercisePolicy < AdminOrAuthorPolicy
admin?
end
[:show?, :study_group_dashboard?].each do |action|
[:show?, :study_group_dashboard?, :feedback?, :requests_for_comments?].each do |action|
define_method(action) { admin? || teacher? }
end
[:clone?, :destroy?, :edit?, :statistics?, :update?, :feedback?].each do |action|
[:clone?, :destroy?, :edit?, :statistics?, :update?].each do |action|
define_method(action) { admin? || author? }
end