Improve code related to the API sudo feature
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
- The API allows admin users to impersonate any other user by using the
sudofeature - The code for this feature is scattered across a few methods in
lib/api/helpers.rb - Background for the creation of this issue: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10842#note_28348788
Potential improvements
-
Rename the
initial_current_usermethod. Currently, during asudocall,initial_current_userpoints to the admin user, andcurrent_userpoints to the user they are impersonating. -
The
sudo-related methods and constants inAPI::Helperscould be moved to a separate class/module/concern.
Edited by 🤖 GitLab Bot 🤖