Add support for signed URLs used by the render_file function
This commit is contained in:
@ -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?
|
||||
|
@ -6,11 +6,15 @@ class SubmissionPolicy < ApplicationPolicy
|
||||
end
|
||||
|
||||
# insights? is used in the flowr_controller.rb as we use it to authorize the user for a submission
|
||||
%i[download? download_file? render_file? run? score? show? statistics? stop? test?
|
||||
%i[download? download_file? run? score? show? statistics? stop? test?
|
||||
insights?].each do |action|
|
||||
define_method(action) { admin? || author? }
|
||||
end
|
||||
|
||||
def render_file?
|
||||
everyone
|
||||
end
|
||||
|
||||
def index?
|
||||
admin?
|
||||
end
|
||||
|
Reference in New Issue
Block a user