New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

userswitch

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

userswitch

  • 0.1.9
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

UserSwitch

Gem Version

UserSwitch is a Rails plugin for switching between commonly used roles and users. It's particularly useful for development and staging environments when you often need to switch between various accounts. It saves you from the hassle of logging in or out.

alt

Example

By default, the gem will output a chain of buttons as follows

By clicking on a button, your Rails app will switch to a different user, that is, your session will change to that of a different account and save you the time you might otherwise spend clicking on logout links and filling in forms to log as a different user.

Different roles have different colors so as to be more noticeable. If we put mulitple "same role" users for testing, we can still see by color coding what role it belongs to.

alt

Requirements

gem 'bootstrap'
gem 'devise'

How to install

Add it to your app's Gemfile and run bundle

gem 'userswitch'

or install it manually

gem install userswitch

How to use

Create userswitch.yml inside you config folder with:

rake userswitch:install

Inside of your template/view, you can call users with (showing only users from yours userswitch.yml):

Userswitch.users(current_user)

The above command will generate the required HTML output to make the switching work.

FAQs

Package last updated on 08 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc