summaryrefslogtreecommitdiffstats
path: root/modules/convert
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-20 08:48:40 +0100
committerGitHub <noreply@github.com>2020-08-20 10:48:40 +0300
commitd15bb17b78f8aee3285b5fadf924ac2dc569f790 (patch)
tree0bfddd906fc953a42e17bdd5cb1f75bf3ce683dc /modules/convert
parentdcb543ac2a9cccc16dd161c820a4a002e8a83e82 (diff)
downloadgitea-d15bb17b78f8aee3285b5fadf924ac2dc569f790.tar.gz
gitea-d15bb17b78f8aee3285b5fadf924ac2dc569f790.zip
Default empty merger list to those with write permissions (#12535)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/convert')
-rw-r--r--modules/convert/convert.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/convert/convert.go b/modules/convert/convert.go
index ec18b13056..94ecdd1150 100644
--- a/modules/convert/convert.go
+++ b/modules/convert/convert.go
@@ -67,8 +67,12 @@ func ToBranch(repo *models.Repository, b *git.Branch, c *git.Commit, bp *models.
}
if user != nil {
+ permission, err := models.GetUserRepoPermission(repo, user)
+ if err != nil {
+ return nil, err
+ }
branch.UserCanPush = bp.CanUserPush(user.ID)
- branch.UserCanMerge = bp.IsUserMergeWhitelisted(user.ID)
+ branch.UserCanMerge = bp.IsUserMergeWhitelisted(user.ID, permission)
}
return branch, nil