未登录附件不能下载问题

This commit is contained in:
huang 2016-04-19 10:55:17 +08:00
parent a907089bd0
commit ade19af9f2
1 changed files with 2 additions and 2 deletions

View File

@ -660,8 +660,8 @@ class AttachmentsController < ApplicationController
end
def has_login
unless @attachment && @attachment.container_type == "Organization"
unless @attachment && @attachment.container_type == "PhoneAppVersion"
unless (@attachment && @attachment.container_type == "Organization").nil?
unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil?
render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download)
end
end