资源显示,对于课程外人员不在显示私有资源

This commit is contained in:
z9hang 2014-12-01 15:03:47 +08:00
parent b82523042e
commit 298b767fc4
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ module FilesHelper
def visable_attachemnts attachments
result = []
attachments.each do |attachment|
if attachment.is_public? || (attachment.container_type == "Course" && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
if attachment.is_public? || (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
result << attachment
end
end
@ -106,7 +106,7 @@ module FilesHelper
def visable_attachemnts_insite attachments,course
result = []
attachments.each do |attachment|
if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
result << attachment
end
end