Can I change role of particular user in multiple projects at a time? If yes, How?
I have a user whose role is "Reporter" in more than 75 projects. I want to change the role to "Developer" in all projects. Can I achieve with minimal efforts?
Can I change role of particular user in multiple projects at a time? If yes, How?
I have a user whose role is "Reporter" in more than 75 projects. I want to change the role to "Developer" in all projects. Can I achieve with minimal efforts?
Copyright © 2021 Jogjafile Inc.
You can edit access of an existing member of a project with the following Gitlab API :
PUT /projects/:id/members/:user_id?access_level=XX.
I didn't find any API to request the projects for a specific user in the User API. But you can request the list of all projects, extract the ids and call the edit member API
What you can do is :
request the user API to get the user id for your target username :
request the list of projects and extracts the ids in a list :
call edit member API for each project with the access level of your choice :
The
access_levelfield can be any of these :Here is a Bash script that will update user with
usernamejohndoe with the access level 30 (Developer access) for all projects where (s)he is member, this script also usesjqjson parser :Note that each request including a project where the specified user is not a member result in a
404.