用户没有权限完成此操作.您需要具有"AddPackage" [英] User lacks permission to complete this action. You need to have 'AddPackage'

查看:94
本文介绍了用户没有权限完成此操作.您需要具有"AddPackage"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个错误:

User XXX lacks permission to complete this action. You need to have 'AddPackage'

当尝试将nuget包推送到Azure DevOps工件时.我是管理员这是阶段:

when trying to push a nuget package to Azure DevOps artifacts. I am the administrator This is the stage:

  - stage:
    displayName: 'Release'
    condition: succeeded()
    jobs:
      - job: 'Publish'
        displayName: 'Publish nuGet Package'
        steps:
          - download: current
            artifact: $(PIPELINE_ARTIFACT_NAME)
            displayName: 'Download pipeline artifact'
          - script: ls $(PATH_PIPELINE_ARTIFACT_NAME)
            displayName: 'Display contents of downloaded articacts path'
          - task: NuGetAuthenticate@0
            displayName: 'Authenticate in NuGet feed'
          - script: dotnet nuget push $(PATH_PIPELINE_ARTIFACT_NAME)/**/*.nupkg --source $(NUGET_FEED) --api-key $(NUGET_API_KEY)
            displayName: 'Uploads nuGet packages'

确切的错误:

error: Response status code does not indicate success: 403 (Forbidden - User '4a2eb786-540d-4690-a12b-013aec2c86e5' lacks permission to complete this action. You need to have 'AddPackage'. (DevOps Activity ID: XXXXXXX-6DF9-4A98-8A4E-42C556C6FC56)).
##[error]Bash exited with code '1'.
Finishing: Uploads nuGet packages

git repo在GitHub中.不知道谁被认为是用户,但我不知道要修改哪些其他权限

The git repo is in GitHub. Not sure who is considered to be the user but I don't know which other permissions to modify

推荐答案

似乎我通过将Build Service作为贡献者添加到feed的权限设置中来解决.

It seems I fixed by adding to the feed's permission settings the Build Service as Contributor.

这有点令人困惑,但是现在可以正常工作了.

It's a bit confusing tbh but it's now working fine.

这篇关于用户没有权限完成此操作.您需要具有"AddPackage"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆