diff --git a/app/policies/code_ocean/file_policy.rb b/app/policies/code_ocean/file_policy.rb index e8d7b5a8..3d5ab473 100644 --- a/app/policies/code_ocean/file_policy.rb +++ b/app/policies/code_ocean/file_policy.rb @@ -15,8 +15,10 @@ module CodeOcean def create? if @record.context.is_a?(Exercise) admin? || author? - else + elsif @record.context.is_a?(Submission) and @record.context.exercise.allow_file_creation author? + else + no_one end end