优化下载权限判断
This commit is contained in:
parent
3b1b057f0a
commit
ed00adb3ba
|
@ -67,6 +67,8 @@ 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
|
||||||
|
else
|
||||||
|
candown = @attachment.is_public == 1
|
||||||
end
|
end
|
||||||
if candown || User.current.admin?
|
if candown || User.current.admin?
|
||||||
@attachment.increment_download
|
@attachment.increment_download
|
||||||
|
|
Loading…
Reference in New Issue