On Sep 25, 4:27 am, Al Shox <[EMAIL PROTECTED]> wrote:
> > Are you talking about authenticating a users connection to the
> > database inside your application?
>
> > If so that has nothing todo with the rails database connection. You
> > need to lookinto a plugin that will do authentication and
> > authorization on the rails application side...
>
> > OR
>
> > You want to lock down the access that you application has to the
> > database?
>
> > GRANT SELECT,DROP ON app_production.* TO 'someuser'@'somewhere'
> > IDENTIFIED BY 'somepassword';
>
> > That gives someuser connecting from host somwhere SELECT and DROP
> > access to the app_production database with the password
> > somepassword ???
>
> > Does that answer your question or am I way off?
>
> I've grant commands setted into database (with GRANT SELECT.......), 3
> grant (for 3 user types).
> For ex, if you are connetted to myhost.com/admin, you will be prompted
> for insert your account information and rails will be connected to
> database with "admin" user.. nothing more, nothing less ;) .
> I know that this don't sound good, but I can't modify my db.. and db
> have grants and views..
> If there are some trick to avoid this..
>
> Thank you
> --
> Posted viahttp://www.ruby-forum.com/.

Something like this?

ActiveRecord::Base.establish_connection(
  :adapter  => "mysql",
  :host     => "localhost",
  :username => "admin",
  :password => "password",
  :database => "database"
)

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to