Skip to content

Commit

Permalink
admins can change external users's names
Browse files Browse the repository at this point in the history
  • Loading branch information
alihadimazeh committed Nov 14, 2024
1 parent eb78da7 commit bf02581
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def create_user_params
end

def update_user_params
@update_user_params ||= if external_auth?
@update_user_params ||= if external_auth? && current_user.role.name.eql?('Administrator')
params.require(:user).permit(:name)
elsif external_auth?
params.require(:user).permit(:password, :avatar, :language, :role_id, :invite_token)
else
params.require(:user).permit(:name, :password, :avatar, :language, :role_id, :invite_token)
Expand Down
8 changes: 4 additions & 4 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bf02581

Please sign in to comment.