未登陆情况下,也能下载组织下的文件

This commit is contained in:
ouyangxuhua 2016-01-19 16:42:10 +08:00
parent 909e0e846b
commit d0c2eabddd
2 changed files with 3 additions and 1 deletions

View File

@ -600,7 +600,7 @@ private
def has_login def has_login
unless @attachment && @attachment.container_type == "PhoneAppVersion" unless @attachment && @attachment.container_type == "PhoneAppVersion"
render_403 unless User.current.logged? render_403 if !User.current.logged? && @attachment.container_type != 'OrgSubfield' && @attachment.container_type != 'OrgDocumentComment'
end end
end end
end end

View File

@ -1996,6 +1996,8 @@ module ApplicationHelper
candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1)
elsif attachment.container.is_a?(OrgSubfield) elsif attachment.container.is_a?(OrgSubfield)
candown = true candown = true
elsif attachment.container.is_a?(OrgDocumentComment)
candown = true
elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board && elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board &&
attachment.container.board.course attachment.container.board.course
course = attachment.container.board.course course = attachment.container.board.course