hm, first when you find someone user.. like in application.rb
controller..
before_filter :find_user
def find_user
...
@user = someone
end
You will have @user for all of controllers/views
This mean you will be able to access/change @user instance from any
ctrl/action
so in some_controller.rb like that :
before_filter :do_something
def do_something
if @user.name == "alexey" do { .... }
end
On Sep 9, 4:21 pm, Yannick K
<li...-h429TZV5m5ZyDzI6CaY1VQ@public.gmane.org>
wrote:> i would like to build a authetication system where i can pass a object
> (precisely the current id in the controller) to the
> before_filter.
> then i do some reflection fun to find out if the passed user has that
> object.
> can that be done? precisely: can i pass a object to a before filter?
>
> thanks
> y
>
> ps. is there any plugin or other interesting concept for ACLs?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---