Skip to content

Commit 4d58be0

Browse files
committed
fix & lint
1 parent f10db1f commit 4d58be0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

routers/web/repo/issue_content_history.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
"code.gitea.io/gitea/models/avatars"
1313
issues_model "code.gitea.io/gitea/models/issues"
14-
"code.gitea.io/gitea/models/unit"
1514
"code.gitea.io/gitea/modules/context"
1615
"code.gitea.io/gitea/modules/log"
1716
"code.gitea.io/gitea/modules/setting"
@@ -91,10 +90,9 @@ func GetContentHistoryList(ctx *context.Context) {
9190
// Admins or owners can always delete history revisions. Normal users can only delete own history revisions.
9291
func canSoftDeleteContentHistory(ctx *context.Context, issue *issues_model.Issue, comment *issues_model.Comment,
9392
history *issues_model.ContentHistory,
94-
) bool {
95-
canSoftDelete := false
93+
) (canSoftDelete bool) {
9694
// 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)) {
95+
if ctx.Repo.IsOwner() || ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) {
9896
canSoftDelete = true
9997
} else {
10098
// for read-only users, they could still post issues or comments,

0 commit comments

Comments
 (0)