From 90bce764092970077b112ee1e3437bc3489a5d12 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 26 Mar 2015 15:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=81=E6=9C=89=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=95=B0=EF=BC=8C=E5=8F=AA=E8=A6=81=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E6=9C=AC=E4=BA=BA=E4=BC=A0=E7=9A=84=EF=BC=8C=E9=83=BD?= =?UTF-8?q?=E7=9C=8B=E4=B8=8D=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/files_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 9eff409ff..884ebc2eb 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -87,7 +87,10 @@ module FilesHelper def visable_attachemnts attachments result = [] attachments.each do |attachment| - if attachment.is_public? || (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + if attachment.is_public? || + (attachment.container_type == "Project" && User.current.member_of?(attachment.project)) || + (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| + attachment.author_id == User.current.id result << attachment end end