diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 268781df3..7f3d2c1a2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1824,7 +1824,7 @@ module ApplicationHelper def attachment_candown attachment candown = false if attachment.container - if attachment.container.class.to_s != "HomeworkAttach" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project + if attachment.container.class.to_s != "HomeworkAttach" && attachment.container.class.to_s != "StudentWork" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project project = attachment.container.project candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) elsif attachment.container.is_a?(Project)