Skip to content

Commit

Permalink
Fix permission check on issue/pull lock (#22113)
Browse files Browse the repository at this point in the history
backport #22110
  • Loading branch information
lunny authored Dec 12, 2022
1 parent b54c064 commit 079ef56
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 @@ -626,7 +626,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 @@ -947,8 +946,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 079ef56

Please sign in to comment.