全站搜索bug

This commit is contained in:
z9hang 2014-12-12 16:59:18 +08:00
parent c0a0c41e14
commit e4439daf3b
1 changed files with 2 additions and 0 deletions

View File

@ -116,6 +116,7 @@ module FilesHelper
def attachment_candown attachment
candown = false
if attachment.container
if attachment.container.class.to_s != "HomeworkAttach" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project
project = attachment.container.project
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
@ -144,6 +145,7 @@ module FilesHelper
else
candown = (attachment.is_public == 1 || attachment.is_public == true)
end
end
candown
end