优化公开资源的下载权限判断
This commit is contained in:
parent
5e462f1ae7
commit
774eed0dbf
|
@ -55,10 +55,10 @@ class AttachmentsController < ApplicationController
|
|||
candown = false
|
||||
if @attachment.container.has_attribute?(:project) && @attachment.container.project
|
||||
project = @attachment.container.project
|
||||
candown= User.current.member_of?(project) || (project.is_public==1 && @attachment.is_public == 1)
|
||||
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
|
||||
elsif @attachment.container.is_a?(Project)
|
||||
project = @attachment.container
|
||||
candown= User.current.member_of?(project) || (project.is_public==1 && @attachment.is_public == 1)
|
||||
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
|
||||
elsif @attachment.container.has_attribute?(:course) && @attachment.container.course
|
||||
course = @attachment.container.course
|
||||
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
||||
|
|
Loading…
Reference in New Issue