From d3837ba03cf7d86a271c2f716c90a1cfb9890fbf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 16 Jun 2015 09:34:21 +0800 Subject: [PATCH] =?UTF-8?q?attachment=5Fcontrol=E5=A2=9E=E5=8A=A0=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E5=88=A4=E6=96=AD=E5=BD=93=E5=89=8D=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 2a772a949..4ecff7a40 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -23,6 +23,7 @@ class AttachmentsController < ApplicationController before_filter :delete_authorize, :only => [:destroy] before_filter :authorize_global, :only => [:upload] before_filter :authorize_attachment_download1, :only => [:download] + before_filter :has_login #before_filter :login_without_softapplication, only: [:download] accept_api_auth :show, :download, :upload require 'iconv' @@ -511,4 +512,8 @@ private format.js end end + + def has_login + render_403 unless User.current.logged? + end end