Add support for signed URLs used by the render_file function

This commit is contained in:
Sebastian Serth
2022-09-23 11:26:56 +02:00
parent 5881795d5f
commit 16c00ec136
16 changed files with 229 additions and 31 deletions

View File

@ -26,6 +26,14 @@ module CodeOcean
end
end
def render_protected_upload?
return no_one if @record.native_file? && !@record.native_file_location_valid?
return no_one if @record.context.is_a?(Exercise) && (@record.context.unpublished || @record.hidden)
# The AuthenticatedUrlHelper will check for more details, but we cannot determine a specific user
everyone
end
def create?
if @record.context.is_a?(Exercise)
admin? || author?