【发布时间】:2010-06-12 23:06:51
【问题描述】:
我有一个用户模型,其访问由 ACL9 控制。
在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。
有人对可能出现的问题有意见吗?
【问题讨论】:
标签: ruby-on-rails authentication authorization devise acl9