Use X-Sendfile to transmit native files and handle file uploads
This commit is contained in:
@ -7,6 +7,8 @@ module CodeOcean
|
||||
end
|
||||
|
||||
def show?
|
||||
return false if @record.native_file? && !@record.native_file_location_valid?
|
||||
|
||||
if @record.context.is_a?(Exercise)
|
||||
admin? || author? || !@record.hidden
|
||||
else
|
||||
@ -14,6 +16,16 @@ module CodeOcean
|
||||
end
|
||||
end
|
||||
|
||||
def show_protected_upload?
|
||||
return false if @record.native_file? && !@record.native_file_location_valid?
|
||||
|
||||
if @record.context.is_a?(Exercise)
|
||||
admin? || author? || (!@record.context.unpublished && !@record.hidden)
|
||||
else
|
||||
admin? || author?
|
||||
end
|
||||
end
|
||||
|
||||
def create?
|
||||
if @record.context.is_a?(Exercise)
|
||||
admin? || author?
|
||||
|
Reference in New Issue
Block a user