From ade19af9f26008ccbaf20acde35f73d20c61f017 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 19 Apr 2016 10:55:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=8B=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 1dacffb6f..fe3c3272a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -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