开发者

Why does a view I think I made public, still prompt me for login? - Rails3 + decl_auth

This is my authorization_rules.rb:

role :guest do
    has_permission_on [:paying_users], :to => [:index]
end

This is my paying_users.rb controller:

class PayingUsersController < ApplicationController
    filter_resource_access

    def index
        @users = User.all
    end

end

This is my routes.rb, the relevant parts anyway:

resources :paying_users

When I go to myapp.com/paying_users it still redirects to me login page, even though I want it to not do that.

How do I fix this?

开发者_高级运维

Using declarative_authorization to handle authorization.


All I had to do was add a before_filter before my filter_resource_access like so:

before_filter :authenticate_user!, :except => :index 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜