Skip to content

Commit

Permalink
fix & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Sep 28, 2023
1 parent f10db1f commit 4d58be0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions routers/web/repo/issue_content_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"code.gitea.io/gitea/models/avatars"
issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
Expand Down Expand Up @@ -91,10 +90,9 @@ func GetContentHistoryList(ctx *context.Context) {
// Admins or owners can always delete history revisions. Normal users can only delete own history revisions.
func canSoftDeleteContentHistory(ctx *context.Context, issue *issues_model.Issue, comment *issues_model.Comment,
history *issues_model.ContentHistory,
) bool {
canSoftDelete := false
) (canSoftDelete bool) {
// CanWrite means the doer can manage the issue/PR list
if ctx.Repo.IsOwner() || (!issue.IsPull && ctx.Repo.CanWrite(unit.TypeIssues)) || (issue.IsPull && ctx.Repo.CanWrite(unit.TypePullRequests)) {
if ctx.Repo.IsOwner() || ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) {
canSoftDelete = true
} else {
// for read-only users, they could still post issues or comments,
Expand Down

0 comments on commit 4d58be0

Please sign in to comment.