mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-20 20:07:03 +01:00
IsUserAllowedToUpdate ignore igonre if user is nil (#14885)
This commit is contained in:
parent
8ac1367718
commit
11229ca539
1 changed files with 3 additions and 0 deletions
|
@ -48,6 +48,9 @@ func Update(pull *models.PullRequest, doer *models.User, message string) error {
|
|||
|
||||
// IsUserAllowedToUpdate check if user is allowed to update PR with given permissions and branch protections
|
||||
func IsUserAllowedToUpdate(pull *models.PullRequest, user *models.User) (bool, error) {
|
||||
if user == nil {
|
||||
return false, nil
|
||||
}
|
||||
headRepoPerm, err := models.GetUserRepoPermission(pull.HeadRepo, user)
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
|
Loading…
Reference in a new issue