mirror of
https://github.com/go-gitea/gitea
synced 2025-08-03 08:08:36 +00:00
* Backport: Repo Transfer permission checks (#14792) * update tests
This commit is contained in:
@@ -93,7 +93,12 @@ func Transfer(ctx *context.APIContext, opts api.TransferRepoOption) {
|
||||
}
|
||||
}
|
||||
|
||||
if err = repo_service.TransferOwnership(ctx.User, newOwner, ctx.Repo.Repository, teams); err != nil {
|
||||
if err = repo_service.StartRepositoryTransfer(ctx.User, newOwner, ctx.Repo.Repository, teams); err != nil {
|
||||
if models.IsErrCancelled(err) {
|
||||
ctx.Error(http.StatusForbidden, "transfer", "user has no right to create repo for new owner")
|
||||
return
|
||||
}
|
||||
|
||||
ctx.InternalServerError(err)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user