获取用户可以访问的项目列表
我有一个自动化网站,并希望向用户显示他们可以在下拉列表中访问的项目列表。 如果我在组织中有管理帐户的AA PAT,如何获取给定用户电子邮件的项目列表?
大概是REST API是这样做的最佳方法?
https:https:// https:// .microsoft.com/en-us/rest/api/azure/devops/?view = azure-devops-rest-7.1
I have a site for automation, and want to display to users a list of projects they have access to in a dropdown.
If I have a a PAT for an admin account in the org, how can I get the list of projects given a user's email?
Presumably the REST api is the best way to do this?
https://learn.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-7.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了两种方法。
:列出所有项目,基于用户列表的过滤
第一个方法
这更好,因为这将显示人们拥有读者(或更高)的所有项目,其中第一个方法没有显示用户没有明确会员资格的项目,
请注意 select 第二个示例中包含的查询参数,这对于
projectEntiTlements
中的结果是必不可少的。I've found two ways to do this.
First method: list all projects, filter based on user list
Second method: get user entitlements
This is better because this will show all projects that people have Reader (or higher) on, where the first method doesn't show projects where the user doesn't have explicit membership
Note the select query parameter included in the second example, this is necessary for
projectEntitlements
to be included in the result.