|
|
|
@ -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
|
|
|
|
|