[英]GitLab: Transferring project to Group shows 403 Forbidden error
$ curl -k -X --request POST -H "Private-Token:Gybr7vzbGHuKDv9PM62z" https://gitlab_host/api/v3/groups/2257/projects/2884 $ curl -k -X --request POST -H "Private-Token:Gybr7vzbGHuKDv9PM62z" https://gitlab_host/api/v3/groups/2257/projects/2884
{"message":"403 Forbidden"} {“消息”:“403 禁止”}
I get the above error.我收到上述错误。 The private token I am using is of my userid and I own both the group (groupid=2257) and the project(projectid=2884).我使用的私有令牌是我的用户 ID,我同时拥有组 (groupid=2257) 和项目 (projectid=2884)。 I can also transfer the project from the GUI.我还可以从 GUI 传输项目。 The above problem is only with the API.上述问题仅适用于 API。 What might be the problem?可能是什么问题?
I found a solution here - to create the project by specifying the namespace_id (groupid). 我在这里找到了解决方案-通过指定namespace_id(groupid)创建项目。 It seems to be adding into the group. 它似乎正在加入该组。
curl -k -X POST -H "Private-Token: XXXXXXXXXXX" " https://gitlab_host/api/v3/projects?name=Team9&namespace_id=2257 " curl -k -X POST -H“私人令牌:XXXXXXXXXXX”“ https:// gitlab_host / api / v3 / projects?name = Team9&namespace_id = 2257 ”
where 2257 is the groupid. 其中2257是groupid。
See GitLab 15.4 (September 2022) can help with:请参阅GitLab 15.4 (2022 年 9 月)可以帮助:
API endpoint to get group transfer locations API 端点获取组转移位置
We added a new Groups API endpoint that returns a list of groups to which you can transfer the current group.我们添加了一个新的 Groups API 端点,该端点返回您可以将当前组转移到的组列表。
See Documentation and Issue .请参阅文档和问题。
That way, you can list first the groups to which you can transfer the current group of your current project.这样,您可以首先列出您可以将当前项目的当前组传输到的组。
Meaning you will transfer your project to a group you know you can transfer to (no 403)这意味着您会将您的项目转移到您知道可以转移到的组(没有 403)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.