| @@ -1051,6 +1051,13 @@ func isCanDelete(ctx *context.Context, modelUserId int64) bool { | |||||
| if ctx.Repo.IsOwner() { | if ctx.Repo.IsOwner() { | ||||
| return true | return true | ||||
| } | } | ||||
| isRepoOwnerCollaborator, err := ctx.Repo.Repository.IsOwnerMemberCollaborator(ctx.User.ID) | |||||
| if err != nil { | |||||
| log.Info("query isRepoOwnerCollaborator error." + err.Error()) | |||||
| } | |||||
| if isRepoOwnerCollaborator { | |||||
| return true | |||||
| } | |||||
| return false | return false | ||||
| } | } | ||||
| @@ -1061,9 +1068,17 @@ func isOperModifyOrDelete(ctx *context.Context, modelUserId int64) bool { | |||||
| if ctx.User.IsAdmin || ctx.User.ID == modelUserId { | if ctx.User.IsAdmin || ctx.User.ID == modelUserId { | ||||
| return true | return true | ||||
| } | } | ||||
| if ctx.Repo.IsOwner() { | if ctx.Repo.IsOwner() { | ||||
| return true | return true | ||||
| } | } | ||||
| isRepoOwnerCollaborator, err := ctx.Repo.Repository.IsOwnerMemberCollaborator(ctx.User.ID) | |||||
| if err != nil { | |||||
| log.Info("query isRepoOwnerCollaborator error." + err.Error()) | |||||
| } | |||||
| if isRepoOwnerCollaborator { | |||||
| return true | |||||
| } | |||||
| return false | return false | ||||
| } | } | ||||