diff options
Diffstat (limited to 'modules/convert/convert.go')
-rw-r--r-- | modules/convert/convert.go | 6 |
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 |