|
|
|
@ -594,7 +594,7 @@ class AttachmentsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
private
|
|
|
|
|
def find_project
|
|
|
|
|
@attachment = Attachment.find(params[:id])
|
|
|
|
|
# Show 404 if the filename in the url is wrong
|
|
|
|
@ -608,7 +608,7 @@ private
|
|
|
|
|
@attachment.container.board.course)
|
|
|
|
|
@course = @attachment.container.board.course
|
|
|
|
|
else
|
|
|
|
|
unless @attachment.container_type == 'Bid'|| @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork'
|
|
|
|
|
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork'
|
|
|
|
|
@project = @attachment.project
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -660,10 +660,8 @@ private
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def has_login
|
|
|
|
|
unless@attachment.container_type == "Organization"
|
|
|
|
|
unless @attachment && @attachment.container_type == "PhoneAppVersion"
|
|
|
|
|
render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|