mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 03:52:36 +02:00
Add permission check when creating PR (#31033)
user should be a collaborator of the base repo to create a PR
This commit is contained in:
1 parent
d109923ed8
commit
e0a408e6f3
7 files changed
+127
-16
No files matched your search
@@ -535,6 +535,8 @@ func CreatePullRequest(ctx *context.APIContext) {
|
||||
ctx.Error(http.StatusBadRequest, "UserDoesNotHaveAccessToRepo", err)
|
||||
} else if errors.Is(err, user_model.ErrBlockedUser) {
|
||||
ctx.Error(http.StatusForbidden, "BlockedUser", err)
|
||||
} else if errors.Is(err, issues_model.ErrMustCollaborator) {
|
||||
ctx.Error(http.StatusForbidden, "MustCollaborator", err)
|
||||
} else {
|
||||
ctx.Error(http.StatusInternalServerError, "NewPullRequest", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user