[英]Assign User as an Administrator to a project once it is created using rest api - Azure DevOps
I am trying to assign a user as an administrator to a project and change the owner too via rest api in Azure DevOps. 我正在尝试将用户指定为项目的管理员,并通过Azure DevOps中的rest api更改所有者。 Could anyone of you point me to some documentation as how it can be done?
你们中的任何人都可以向我指出一些文件是如何完成的吗? I have looked at UserEntitlements API and Project API - but I haven't figured how I can use them for my issue.
我查看了UserEntitlements API和Project API - 但我还没想到如何将它们用于我的问题。 Any directions on this would be helpful.
任何指示都会有所帮助。
Thanks! 谢谢!
Assign User as an Administrator to a project once it is created using rest api - Azure DevOps
使用rest api - Azure DevOps创建项目后,将用户指定为项目管理员
Just as you know in your previous post, we could also use the API User Entitlements - Update User Entitlement to assign a user as an administrator to a project: 正如您在上一篇文章中所知,我们还可以使用API 用户权利 - 更新用户权利来将用户指定为项目的管理员:
The Request body as following: 请求正文如下:
[
{"from":"",
"op":0,
"path":"/projectEntitlements",
"value":{"projectRef":{"id":"<MyProjectID>"},"group":{"groupType":3}}
}
]
Then I could add a user to a specific project (I am using postman): 然后我可以将用户添加到特定项目(我使用邮递员):
As result, the status is 200 OK and the use is added to the project. 结果,状态为200 OK,并将使用添加到项目中。
You can try the Request body I posted above (Replace the to your specify project ID) and groupType is used to set different permissions: 您可以尝试我上面发布的请求主体(替换为您指定的项目ID),groupType用于设置不同的权限:
Besides, you said you want change the owner too, do you mean change organization owner via api? 此外,你说你想要改变所有者,你的意思是通过api改变组织所有者吗? If yes, I am afraid there is no such API for update the organization owner, we could only list the owner.
如果是,我担心没有这样的API来更新组织所有者,我们只能列出所有者。
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.