I am using Authlogic for authentification and
rails_authorization_plugin for authorization
when needed, at the beginning of a controller I write
before_filter :require_user # can be also require_no_user to
exclude multi-sessions from same user
before_filter :check_authorization, :except => :index # to
control access
and at the end of the controller , check for the all page access...
can be also per action
# If the user is not authorized, just throw the exception.
def check_authorization
permit "superadmin or administrator" do
return
end
render_403
end
On 25 juil, 03:09, Rilindo Foster <
rili...@gmail.com> wrote:
> Hey, that is easier. I'll have to save this.
>
> Thanks!
>
> On Jul 24, 2009, at 8:54 PM, James Englert wrote:
>
>
>
> > It would probably be easier to prevent users from viewing those
> > pages using a filter. If you are using AuthenticatedSystem, you
> > might be able to tap into the login_required function. An example
> > filter would be like
>
> > <.. in your controller class ..>
> > before_filter :login_required, :except => [:show]
>
> > Hope that helps.
>
> > On Fri, Jul 24, 2009 at 8:41 PM, Rilindo Foster <
rili...@gmail.com>