Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !3525

Merged
Created Apr 05, 2013 by Administrator@rootOwner

API: admin users can sudo commands as other users

  • Overview 35
  • Commits 3
  • Changes 5

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).

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/karlhungus/api_sudo