首页 文章

使用VSTS REST API上载的附件不适用于其他用户

提问于
浏览
0

我使用VSTS REST API使用PATCH请求将附件上传到工作项,并且它很好 . 现在,如果我在同一个团队项目中使用另一个用户来访问工作项目中的附件,则会显示Unauthorized Read Access .

{"$id":"1","innerException":null,"message":"VS402330: Unauthorized Read access to the attachment under the areas ","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.WorkItemUnauthorizedAttachmentException, Microsoft.TeamFoundation.WorkItemTracking.Server","typeKey":"WorkItemUnauthorizedAttachmentException","errorCode":0,"eventId":3200}

注意:我使用的其他用户是在默认域中的Azure AD中创建的 - 即 - user.account@xyz.onmicrosoft.com


Here are the Repro Steps:

Prerequsites

  • 将一些用户添加到VSTS - (我在AzurePortal中使用默认域(xxxx.onmicrosoft.com)创建了5个用户 - 因此用户ID类似于test.user01@xxxxoutlook.onmicrosoft.com)

  • 将这些用户添加到集合级别安全性区域中的集合级别用户组

  • 使用在步骤2中创建的gropup将这些用户添加到项目级别安全区域中的"Team" .

Repro步骤:

  • 使用C# Client Libraries here将附件上传到VSTS;要上传,我们需要使用某种形式的身份验证;该项目使用VssCredentials,它使用CredentialCache.DefaultCredentials . 我已经尝试过这个以及可以为vsts用户安全区域中的任何用户创建的个人访问令牌 .

  • 成功上传后,API会返回参考网址 . 获取网址;

  • 将网址粘贴到浏览器中并尝试使用用于上传文件的同一帐户获取该文件;该文件应该成功显示/下载 .

  • 从vsts注销并以在prerequs中创建的其他用户之一登录 .

  • 将附件网址粘贴到浏览器中并尝试再次获取该文件;

  • 它不会下载文件,而是会引发未经授权的读取访问 . { "$id": "1", "innerException": null, "message": "VS402330: Unauthorized Read access to the attachment under the areas ", "typeName": "Microsoft.TeamFoundation.WorkItemTracking.Server.WorkItemUnauthorizedAttachmentException, Microsoft.TeamFoundation.WorkItemTracking.Server", "typeKey": "WorkItemUnauthorizedAttachmentException", "errorCode": 0, "eventId": 3200 }

1 回答

  • 0

    我可以在上传用户将附件与工作项关联之前重现此问题 . 有反馈意见,您可以投票并遵循:VSTS REST API upload attachment file issue .

    解决方法是您可以将附件与工作项相关联,然后其他人可以访问它们 .

相关问题