Fix admin handling at merge of PR (#9749)
* Admin shall be able to bypass merge checks. * Repository admin should not bypass if merge whitelist is set. * Add code comment about checks that PR are ready * notAllOverrideableChecksOk->notAllOverridableChecksOk * Fix merge, require signed currently not overridable. * fix Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
This commit is contained in:
parent
d3468ed79f
commit
18e0447b3f
3 changed files with 18 additions and 19 deletions
|
@ -487,9 +487,6 @@ func IsSignedIfRequired(pr *models.PullRequest, doer *models.User) (bool, error)
|
|||
|
||||
// IsUserAllowedToMerge check if user is allowed to merge PR with given permissions and branch protections
|
||||
func IsUserAllowedToMerge(pr *models.PullRequest, p models.Permission, user *models.User) (bool, error) {
|
||||
if p.IsAdmin() {
|
||||
return true, nil
|
||||
}
|
||||
if !p.CanWrite(models.UnitTypeCode) {
|
||||
return false, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue