From 24a36e84cc8f582ea7cd0d312777e083cd24e279 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 4 Feb 2019 00:56:18 +0000 Subject: Issue 5924 fix compare button (#5929) * Revert #5877 This unfortunately was not the solution. Signed-off-by: Andrew Thornton * Change permission check to create pull requests to CanReadIssuesOrPulls Signed-off-by: Andrew Thornton --- routers/api/v1/repo/pull.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'routers/api') diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 2ad321ea38..64c7e94474 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -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, "", "" } -- cgit v1.2.3