0
我有一個用戶模型,其訪問由ACL9控制。acl9和devise似乎不能很好地協同工作
在UsersController
:
#ACL9 related stuff
before_filter :load_user, :only => [:show]
access_control do
allow :owner, :of => :user, :to => [:show]
end
def load_user
user = User.find(params[:id])
end
在ApplicationController
:
rescue_from 'Acl9::AccessDenied', :with => :access_denied
def access_denied
authenticate_user! # a method from Devise
end
這是在http://localhost:3000/users/sign_in
頁籤中鍵入URL沒有問題,但是當例如我在輸入這是一個問題用戶頁面,我期望通過上面的邏輯重定向到自動登錄頁面。
http://localhost:3000/users/1
=>無限重定向地獄。它試圖再次重定向到users/1
而不是指向users/sign_in
。
有沒有人有什麼意見可能會出錯?