Refactor external_user_statistics to own controller action
This commit is contained in:

committed by
Sebastian Serth

parent
6ca5982a45
commit
2141fdb1ac
@ -5,7 +5,7 @@ class ExercisePolicy < AdminOrAuthorPolicy
|
||||
admin?
|
||||
end
|
||||
|
||||
%i[show? feedback? statistics? rfcs_for_exercise?].each do |action|
|
||||
%i[show? feedback? statistics? external_user_statistics? rfcs_for_exercise?].each do |action|
|
||||
define_method(action) { admin? || teacher_in_study_group? || (teacher? && @record.public?) || author? }
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user