Add access to statistics for users

This commit is contained in:
Sebastian Serth
2019-11-29 15:40:21 +01:00
parent ab96fb92c2
commit 96c90d0a62
2 changed files with 3 additions and 3 deletions

View File

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