老师和同课程的学生有权限下周作品附件

sw_new_course
sw 10 years ago
parent 837fbe74e8
commit f2ea879b9b

@ -1824,7 +1824,7 @@ module ApplicationHelper
def attachment_candown attachment def attachment_candown attachment
candown = false candown = false
if attachment.container 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 project = attachment.container.project
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
elsif attachment.container.is_a?(Project) elsif attachment.container.is_a?(Project)

Loading…
Cancel
Save