Using ActiveRBAC 0.3.1 to restrict entire site?


#1

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 F.
The Norcross Group
Forensics for the 21st Century