私有项目的资源数,只要不是本人传的,都看不到

dev_repository_hjq
lizanle 10 years ago
parent 297b3c42b1
commit 90bce76409

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

Loading…
Cancel
Save