attachment_control增加过滤器判断当前是否登录
This commit is contained in:
parent
e6b82e5463
commit
d3837ba03c
|
@ -23,6 +23,7 @@ class AttachmentsController < ApplicationController
|
||||||
before_filter :delete_authorize, :only => [:destroy]
|
before_filter :delete_authorize, :only => [:destroy]
|
||||||
before_filter :authorize_global, :only => [:upload]
|
before_filter :authorize_global, :only => [:upload]
|
||||||
before_filter :authorize_attachment_download1, :only => [:download]
|
before_filter :authorize_attachment_download1, :only => [:download]
|
||||||
|
before_filter :has_login
|
||||||
#before_filter :login_without_softapplication, only: [:download]
|
#before_filter :login_without_softapplication, only: [:download]
|
||||||
accept_api_auth :show, :download, :upload
|
accept_api_auth :show, :download, :upload
|
||||||
require 'iconv'
|
require 'iconv'
|
||||||
|
@ -511,4 +512,8 @@ private
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_login
|
||||||
|
render_403 unless User.current.logged?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue