Tag: 开关用户

Rails:切换用户Gem以及切换回原始用户的问题

在我的应用程序中,我使用switch_user ( https://github.com/flyerhzm/switch_user )gem来允许管理员以另一个用户身份登录。 gem有能力以管理员身份重新登录,但我很难概念化如何做到这一点。 这是我的配置: SwitchUser.setup do |config| # provider may be :devise, :authlogic, :clearance, :restful_authentication, :sorcery, or :session config.provider = :devise # available_users is a hash, # key is the model name of user (:user, :admin, or any name you use), # value is a block that return the users that can be […]