Skip to content

Commit

Permalink
Fix permission check on issue/pull lock (go-gitea#22110)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Dec 12, 2022
1 parent 36a2d2f commit 87c64f6
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 @@ -655,7 +655,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 @@ -992,8 +991,8 @@ func RegisterRoutes(m *web.Route) {
})
})
m.Post("/reactions/{action}", web.Bind(forms.ReactionForm{}), repo.ChangeIssueReaction)
m.Post("/lock", reqRepoIssueWriter, web.Bind(forms.IssueLockForm{}), repo.LockIssue)
m.Post("/unlock", reqRepoIssueWriter, repo.UnlockIssue)
m.Post("/lock", reqRepoIssuesOrPullsWriter, web.Bind(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 87c64f6

Please sign in to comment.