fix: do permission check for repository redirect

This commit is contained in:
Gusted 2025-08-21 16:58:27 +02:00 committed by Earl Warren
commit ca7fcacddc
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 46 additions and 19 deletions

View file

@ -174,7 +174,7 @@ func repoAssignment() func(ctx *context.APIContext) {
repo, err := repo_model.GetRepositoryByName(ctx, owner.ID, repoName)
if err != nil {
if repo_model.IsErrRepoNotExist(err) {
redirectRepoID, err := repo_model.LookupRedirect(ctx, owner.ID, repoName)
redirectRepoID, err := redirect_service.LookupRepoRedirect(ctx, ctx.Doer, owner.ID, repoName)
if err == nil {
context.RedirectToRepo(ctx.Base, redirectRepoID)
} else if repo_model.IsErrRedirectNotExist(err) {