Commit dfe41c15 authored by's avatar
Browse files

protect internal users from impersonation

parent 0ea04cc5
......@@ -32,6 +32,10 @@ def impersonate
if user.blocked?
flash[:alert] = "You cannot impersonate a blocked user"
redirect_to admin_user_path(user)
elsif user.internal?
flash[:alert] = "You cannot impersonate an internal user"
redirect_to admin_user_path(user)
session[:impersonator_id] =
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment