Hello, I want to implement authentication using the authlogic gem in an application that already implements a User model that I cannot modify. The authlogic authentication would be for something like a new AdminUser model, completely separate from the existing User model. Since authlogic is installed as a gem on the server (and used by other applications), the gem code itself cannot be modified. Any tips for where to begin/how to approach this? thanks. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This sounds like a bad idea, however, you can pack the gems (move them into the vendor directory) and modify them there. If you have to make significant changes, you can always fork the code and create your own gem. Darian Shimy -- http://www.darianshimy.com http://twitter.com/dshimy On Thu, Nov 26, 2009 at 3:28 AM, athem <allan.m.miller-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I want to implement authentication using the authlogic gem in an > application that already implements a User model that I cannot > modify. The authlogic authentication would be for something like a > new AdminUser model, completely separate from the existing User model. > > Since authlogic is installed as a gem on the server (and used by other > applications), the gem code itself cannot be modified. > > Any tips for where to begin/how to approach this? > > thanks. > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Quoting athem <allan.m.miller-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Hello, > > I want to implement authentication using the authlogic gem in an > application that already implements a User model that I cannot > modify. The authlogic authentication would be for something like a > new AdminUser model, completely separate from the existing User model. > > Since authlogic is installed as a gem on the server (and used by other > applications), the gem code itself cannot be modified. > > Any tips for where to begin/how to approach this? >What happens if you just add acts_as_authenticated to the AdminUser model? It may take a little monkeying about to discover what AuthLogic is expecting the other pieces to be named, like sessions. Give it a try. And report back here on the list for the future. Jeffrey -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Maybe a stupid question here, but could you not make AdminUser a subclass of User and turn off the authlogic on User methods? I guess what I''m asking here is are there certain design requirements in your project which dictate that the AdminUser class *must* be separated from the base User class? It seems that if the AdminUser needs to be separate — and you need to user authlogic — the logical choice would be to fork the gem and make your modifications to that copy instead of monkeying around in the official gem. It may also be easier to just add access control to the existing User class which allows certain users to be Admins. Just trying to wrap my head around this. :) On Nov 26, 6:28 am, athem <allan.m.mil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I want to implement authentication using the authlogic gem in an > application that already implements a User model that I cannot > modify. The authlogic authentication would be for something like a > new AdminUser model, completely separate from the existing User model. > > Since authlogic is installed as a gem on the server (and used by other > applications), the gem code itself cannot be modified. > > Any tips for where to begin/how to approach this? > > thanks.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.