[Rails] Re: acl_system help is needed

Ezra Zygmuntowicz
Mon, 17 Jul 2006 04:53:03 -0000

On Jul 16, 2006, at 9:46 PM, Josh Kieschnick wrote:

> ok, after spending a whole day fighting with this, i think i know what
> was wrong.
>
> when i was testing my program, there wasn''t a user logged in.
> everything
> in the acl_system plugin was being executed before the methods in
> "before_filter". i don''t know if this is a bug or if
something i
> did was
> wrong, but the only way it is working for me right now is if the login
> controller is the first thing the user sees. if the user isn''t
> logged in
> before going to a controller with "access_control" the
"current_user"
> method returns nil and causes the whole thing to shut down.
>
> there is some terminology i am still not quite familiar with so i
> might
> not be explaining this right, so i will give more info if anyone can
> help me out and give me any pointers on using this.
>
> --


I think you have the right idea. You need to make sure that a user
has authenticated before you let the access_control filter run. So
only use access_control on actions in your controller that require
user login.  If one of your controller actions doesn''t need a user to
log in to see , then it doesn''t need to perform access_control either.


-Ezra