资源显示,对于课程外人员不在显示私有资源
This commit is contained in:
parent
b82523042e
commit
298b767fc4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue