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

2、作品附件下载成功之后消失
This commit is contained in:
sw 2015-05-29 09:38:59 +08:00
parent a8b26715d4
commit 837fbe74e8
2 changed files with 6 additions and 2 deletions

View File

@ -428,7 +428,7 @@ private
@attachment.container.board.course)
@course = @attachment.container.board.course
else
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type = 'StudentWorksScore'
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWorks'
@project = @attachment.project
end
end

View File

@ -1844,7 +1844,11 @@ module ApplicationHelper
attachment.container.board.course
course = attachment.container.board.course
candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1)
elsif attachment.container.class.to_s=="HomeworkAttach" && attachment.container.bid.reward_type == 3
elsif attachment.container.class.to_s=="HomeworkAttach"
candown = true
elsif attachment.container.class.to_s=="StudentWorksScore"
candown = true
elsif attachment.container.class.to_s=="StudentWork"
candown = true
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
course = attachment.container.courses.first