mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 23:16:52 +02:00
Issue 5924 fix compare button (#5929)
* Revert #5877 This unfortunately was not the solution. Signed-off-by: Andrew Thornton <art27@cantab.net> * Change permission check to create pull requests to CanReadIssuesOrPulls Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
1 parent
01c10a951b
commit
24a36e84cc
3 files changed
+5
-5
No files matched your search
@@ -668,8 +668,8 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption)
|
||||
ctx.ServerError("GetUserRepoPermission", err)
|
||||
return nil, nil, nil, nil, "", ""
|
||||
}
|
||||
if !perm.CanWrite(models.UnitTypeCode) {
|
||||
log.Trace("ParseCompareInfo[%d]: does not have write access or site admin", baseRepo.ID)
|
||||
if !perm.CanReadIssuesOrPulls(true) {
|
||||
log.Trace("ParseCompareInfo[%d]: cannot create/read pull requests", baseRepo.ID)
|
||||
ctx.Status(404)
|
||||
return nil, nil, nil, nil, "", ""
|
||||
}
|
||||
|
||||
@@ -684,8 +684,8 @@ func ParseCompareInfo(ctx *context.Context) (*models.User, *models.Repository, *
|
||||
ctx.ServerError("GetUserRepoPermission", err)
|
||||
return nil, nil, nil, nil, "", ""
|
||||
}
|
||||
if !perm.CanWrite(models.UnitTypeCode) {
|
||||
log.Trace("ParseCompareInfo[%d]: does not have write access or site admin", baseRepo.ID)
|
||||
if !perm.CanReadIssuesOrPulls(true) {
|
||||
log.Trace("ParseCompareInfo[%d]: cannot create/read pull requests", baseRepo.ID)
|
||||
ctx.NotFound("ParseCompareInfo", nil)
|
||||
return nil, nil, nil, nil, "", ""
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user