Some improvements

This commit is contained in:
Lunny Xiao
2024-12-12 11:53:04 -08:00
parent a2804a5efc
commit 743cebe66f
3 changed files with 50 additions and 36 deletions
+3
View File
@@ -423,6 +423,9 @@ func CreatePullRequest(ctx *context.APIContext) {
return
}
// we just need to check the head repository's permission here because the base
// repository's permission is already checked in api.go with
// mustAllowPulls, reqRepoReader(unit.TypeCode)
if !ci.IsSameRepo() {
// user should have permission to read headrepo's codes
permHead, err := access_model.GetUserRepoPermission(ctx, ci.HeadRepo, ctx.Doer)