Skip to content

Commit f10db1f

Browse files
committed
check issue/PR writable
1 parent 833d983 commit f10db1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/web/repo/issue_content_history.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ func canSoftDeleteContentHistory(ctx *context.Context, issue *issues_model.Issue
9393
history *issues_model.ContentHistory,
9494
) bool {
9595
canSoftDelete := false
96-
// CanWrite means the doer can manage the issue list
97-
if ctx.Repo.IsOwner() || ctx.Repo.CanWrite(unit.TypeIssues) {
96+
// CanWrite means the doer can manage the issue/PR list
97+
if ctx.Repo.IsOwner() || (!issue.IsPull && ctx.Repo.CanWrite(unit.TypeIssues)) || (issue.IsPull && ctx.Repo.CanWrite(unit.TypePullRequests)) {
9898
canSoftDelete = true
9999
} else {
100100
// for read-only users, they could still post issues or comments,

0 commit comments

Comments
 (0)