403 您无权执行促销 'snapshotToRelease'

403 You are not permitted to execute the promotion 'snapshotToRelease'

我正在尝试通过 artifactory 发布特定版本。升级到发布文件夹会出现 403 错误,错误如下:

{
 "errors" : [ {
   "status" : 403,
   "message" : "You are not permitted to execute the promotion 'snapshotToRelease'."
 } ]
}

查看错误,这是一个权限问题,我已经为尝试发布构建但没有成功的用户尝试了大部分权限。下面是我要执行的 api 资源

/api/plugins/build/promote/snapshotToRelease

我想你正在使用 this plugin?

此促销的配置方式,只有以下用户可以运行:

  • 具有 admin 权限的用户
  • 用户名为“jenkins”的用户

如果这些都没有描述相关用户,并且您可以编辑插件文件,您可以更改代码以与其他用户一起使用:

snapshotToRelease(users: ["my-promoter"], params: ...) { buildName, buildNumber, params ->
    // ...
}

或群组中的任何用户:

snapshotToRelease(groups: ["my-promote-group"], params: ...) { buildName, buildNumber, params ->
    // ...
}

(有关详细信息,请参阅 documentation。)