Forum: Ruby on Rails Using ActiveRBAC 0.3.1 to restrict entire site?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
25bbc96d9c53647354cb724e744b2222?d=identicon&s=25 Greg Freemyer (Guest)
on 2006-05-04 23:01
(Received via mailing list)
All,

I'm trying Active_rbac for the first time.

I have the basics working so I can protect a single controller.

I want to protect all of my controllers so users have to login to see
anything.

I'm trying to put a before_filter in my application controller, but I
don't know how to do the except correctly. I've been trying this:

class ApplicationController < ActionController::Base
    before_filter :protect_all, :except => 'login'

protected
    def protect_all
        if !session[:rbac_user].nil?
                return true
        else
                redirect_to "/active_rbac/login"
                return false
        end
    end
end

Is there a way to use :except for this, or do I need to go about this
a diffent way?

Thanks
Greg


--
Greg Freemyer
The Norcross Group
Forensics for the 21st Century
This topic is locked and can not be replied to.