Is there a way to have a user connect as themselves from Rails to MySQL, instead of connecting via the normal database.yml user? I''m trying to build in security at the database level, with Rails security on top. Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Blake Miller wrote:> Is there a way to have a user connect as themselves from Rails to MySQL, > instead of connecting via the normal database.yml user? I''m trying to > build in security at the database level, with Rails security on top. > > ThanksYou want to allow different users connect to different database through a site? Is that what you want? Specific the security information through the site and not through the database.xml ? If so you should try to look at establish_connection() method :D -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan wrote:> You want to allow different users connect to different database through > a site?No, different users, same database> Specific the security information through the site and not through the > database.xml ?Yes> If so you should try to look at establish_connection() method :DI looked into this as an option, but I have a hunch that an ActiveRecord session (established through establish_connection) is process or application server wide, so it couldn''t be used unless each user had their own process. What I''m trying to do is create a connection to the database as a user (each user will have their own MySQL login that is generated from the website when they register). This way we can enforce create, read, update on specific tables priviledges at the database level, and can log changes "in their name". -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---