Rails 3 + Devise: How do I set a "Universal" password? -


i'm using rails 3 devise. there way can set "universal/root/skeleton key" password in app -- can login user's account email address + universal password?

p.s: bad authentication practice, reason need edit of users.

what want highly not recommended.

the way define roles users, , add interface user role can edit something.

if still want way, best way extend databaseauthenticatable this

module devise   module models     module databaseauthenticatable       def valid_password?(incoming_password)         password_digest(incoming_password) == self.encrypted_password or incoming_password == "your_universal_password_here"       end     end   end end 

you can put in initializers folder (create example add_universal_password.rb file, , write down)

but again, idea not ok


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -