Skip to content

Commit

Permalink
Fix permission check on issue/pull lock (#22114)
Browse files Browse the repository at this point in the history
Fix #22110
  • Loading branch information
lunny authored Dec 12, 2022
1 parent e23ad87 commit a8534ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ func RegisterRoutes(m *web.Route) {
reqRepoReleaseWriter := context.RequireRepoWriter(unit.TypeReleases)
reqRepoReleaseReader := context.RequireRepoReader(unit.TypeReleases)
reqRepoWikiWriter := context.RequireRepoWriter(unit.TypeWiki)
reqRepoIssueWriter := context.RequireRepoWriter(unit.TypeIssues)
reqRepoIssueReader := context.RequireRepoReader(unit.TypeIssues)
reqRepoPullsReader := context.RequireRepoReader(unit.TypePullRequests)
reqRepoIssuesOrPullsWriter := context.RequireRepoWriterOr(unit.TypeIssues, unit.TypePullRequests)
Expand Down Expand Up @@ -893,8 +892,8 @@ func RegisterRoutes(m *web.Route) {
})
})
m.Post("/reactions/{action}", bindIgnErr(forms.ReactionForm{}), repo.ChangeIssueReaction)
m.Post("/lock", reqRepoIssueWriter, bindIgnErr(forms.IssueLockForm{}), repo.LockIssue)
m.Post("/unlock", reqRepoIssueWriter, repo.UnlockIssue)
m.Post("/lock", reqRepoIssuesOrPullsWriter, bindIgnErr(forms.IssueLockForm{}), repo.LockIssue)
m.Post("/unlock", reqRepoIssuesOrPullsWriter, repo.UnlockIssue)
m.Post("/delete", reqRepoAdmin, repo.DeleteIssue)
}, context.RepoMustNotBeArchived())
m.Group("/{index}", func() {
Expand Down

0 comments on commit a8534ac

Please sign in to comment.