From e4439daf3b5f284e998143500f79e087455ab36e Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 12 Dec 2014 16:59:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E7=AB=99=E6=90=9C=E7=B4=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/files_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 2ec7e6f45..de87b5c8a 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -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