Merge branch 'szzh' of http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git into szzh
This commit is contained in:
commit
735cb44877
|
@ -64,7 +64,7 @@ class AttachmentsController < ApplicationController
|
||||||
# modify by nwb
|
# modify by nwb
|
||||||
# 下载添加权限设置
|
# 下载添加权限设置
|
||||||
candown = false
|
candown = false
|
||||||
if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project
|
if @attachment.container.class.to_s != "HomeworkAttach" &&(@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)
|
||||||
|
@ -89,7 +89,6 @@ class AttachmentsController < ApplicationController
|
||||||
elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses
|
elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses
|
||||||
candown = User.current.member_of_course?(@attachment.container.courses.first) || (course.is_public == 1 && @attachment.is_public == 1)
|
candown = User.current.member_of_course?(@attachment.container.courses.first) || (course.is_public == 1 && @attachment.is_public == 1)
|
||||||
else
|
else
|
||||||
|
|
||||||
candown = @attachment.is_public == 1
|
candown = @attachment.is_public == 1
|
||||||
end
|
end
|
||||||
if candown || User.current.admin? || User.current.id == @attachment.author_id
|
if candown || User.current.admin? || User.current.id == @attachment.author_id
|
||||||
|
|
Loading…
Reference in New Issue