GRN2-309: Allows admins to edit a non-local users name and email (#2389)

* Allows admins to edit a non-local users name and email

* Fixed edge case
This commit is contained in:
Ahmad Farhat
2020-12-24 13:21:56 -05:00
committed by GitHub
parent 86e6056d3c
commit b2500e6504
4 changed files with 30 additions and 4 deletions

View File

@ -92,7 +92,7 @@ class UsersController < ApplicationController
redirect_path = current_user.admin_of?(@user, "can_manage_users") ? path : edit_user_path(@user)
unless @user.greenlight_account?
unless can_edit_user?(@user, current_user)
params[:user][:name] = @user.name
params[:user][:email] = @user.email
end