-
Notifications
You must be signed in to change notification settings - Fork 4
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.
- 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
- 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.
-
Look at the schools output (https://qa-etd.library.emory.edu/schools) to make sure they're gone.
-
Remove them from
admin_sets.yml
andsuperusers.yml
- Follow this guide