Skip to content

API: admin users can sudo commands as other users

Matthias Käppler requested to merge github/fork/karlhungus/api_sudo into master

Created by: karlhungus

Specifying a header of SUDO or adding a :sudo data with either user id, or username of the user will set the current_user to be that user if your identifying private_token/PRIVATE_TOKEN is an administrator token

Motive: I want to be able to migrate people from other repository management systems to gitlab, I need to be able to do things on their behalf.

Method: when current_user is retrieved check if a SUDO value is set, if so it's not the current user, and the current user is an admin, change current_user to be the sudo specified user (where that is an id, or a username).

Merge request reports

Loading