fix codeharbor_export policies, add specs
This commit is contained in:
@ -19,10 +19,14 @@ class ExercisePolicy < AdminOrAuthorPolicy
|
||||
admin?
|
||||
end
|
||||
|
||||
[:clone?, :destroy?, :edit?, :update?, :export_external_check?, :export_external_confirm?].each do |action|
|
||||
[:clone?, :destroy?, :edit?, :update?].each do |action|
|
||||
define_method(action) { admin? || teacher_in_study_group? || author? }
|
||||
end
|
||||
|
||||
[:export_external_check?, :export_external_confirm?].each do |action|
|
||||
define_method(action) { (admin? || teacher_in_study_group? || author?) && @user.codeharbor_link }
|
||||
end
|
||||
|
||||
[:implement?, :working_times?, :intervention?, :search?, :submit?, :reload?].each do |action|
|
||||
define_method(action) { everyone }
|
||||
end
|
||||
|
Reference in New Issue
Block a user