Skip to content

How to Remove a User

Bess Sadler edited this page Jul 18, 2019 · 5 revisions

When someone who has been an admin or an approver leaves Emory, it's a good idea to remove them from the system. Also, if someone used to be an approver for several departments, and now will be an approver for only some of those, you'll need to remove them entirely and then re-add them via the procedure documented here.

  1. If this is an admin user, you will have to remove them from the admin role:
 admin_role = Role.find_or_create_by(name: 'admin')
 admin_role.users
 admin_role.users = admin_role.users.reject { |m| m.id == 74 } # where 74 is the id of the user we're removing
 admin_role.save
  1. Remove them from the system. Open a rails console, find the user, and use the destroy! method, like this:
u = ::User.find_by(uid: 'bnash3')
u.destroy!

If you still can't remove the user, you can instead remove them from all their workflow roles via the dashboard.

  1. Look at the schools output (https://qa-etd.library.emory.edu/schools) to make sure they're gone.

  2. Remove them from admin_sets.yml and superusers.yml - Follow this guide