mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-26 04:35:54 +00:00
fix: do permission check for repository redirect
This commit is contained in:
parent
50837322cc
commit
ca7fcacddc
6 changed files with 46 additions and 19 deletions
|
@ -31,6 +31,7 @@ import (
|
|||
"forgejo.org/modules/structs"
|
||||
"forgejo.org/modules/util"
|
||||
"forgejo.org/services/context"
|
||||
redirect_service "forgejo.org/services/redirect"
|
||||
repo_service "forgejo.org/services/repository"
|
||||
|
||||
"github.com/go-chi/cors"
|
||||
|
@ -111,7 +112,7 @@ func httpBase(ctx *context.Context) *serviceHandler {
|
|||
return nil
|
||||
}
|
||||
|
||||
if redirectRepoID, err := repo_model.LookupRedirect(ctx, owner.ID, reponame); err == nil {
|
||||
if redirectRepoID, err := redirect_service.LookupRepoRedirect(ctx, ctx.Doer, owner.ID, reponame); err == nil {
|
||||
context.RedirectToRepo(ctx.Base, redirectRepoID)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue