|
|
@ -87,8 +87,9 @@ class AttachmentsController < ApplicationController
|
|
|
|
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
|
|
|
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" && @attachment.container.bid.reward_type == 3
|
|
|
|
candown = true
|
|
|
|
candown = true
|
|
|
|
elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses
|
|
|
|
elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses.first
|
|
|
|
candown = User.current.member_of_course?(@attachment.container.courses.first) || (course.is_public == 1 && @attachment.is_public == 1)
|
|
|
|
course = @attachment.container.courses.first
|
|
|
|
|
|
|
|
candown = User.current.member_of_course?(course) || (course.is_public == 1 && @attachment.is_public == 1)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
candown = @attachment.is_public == 1
|
|
|
|
candown = @attachment.is_public == 1
|
|
|
|