From 564da2ed72fc535b917f9d8d2129588340776301 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 9 Sep 2016 15:36:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=AF=BE=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 3 ++- app/controllers/attachments_controller.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d14bccc4e..ad0fab173 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -372,7 +372,8 @@ class ApplicationController < ActionController::Base return true end - if allowed + + if allowed || (params[:type] && params[:type] == "wechat" ) true else if @project && @project.archived? diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 2e85d8a72..3986acc0a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -130,7 +130,7 @@ class AttachmentsController < ApplicationController def download # modify by nwb # 下载添加权限设置 - if params[:type] == "wechat" + if (params[:type] && params[:type] == "wechat" ) candown = true else candown = attachment_candown @attachment @@ -715,7 +715,7 @@ class AttachmentsController < ApplicationController def has_login 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) + render_403 if (!User.current.logged? && !(params[:type] && params[:type] == "wechat")) && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) end end end