attachment_control增加过滤器判断当前是否登录

This commit is contained in:
sw 2015-06-16 09:34:21 +08:00
parent e6b82e5463
commit d3837ba03c
1 changed files with 5 additions and 0 deletions

View File

@ -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