mirror of
1
Fork 0

Fix permission check on issue/pull lock (#22114)

Fix #22110
This commit is contained in:
Lunny Xiao 2022-12-13 03:59:28 +08:00 committed by GitHub
parent e23ad87b55
commit a8534ac4a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -599,7 +599,6 @@ func RegisterRoutes(m *web.Route) {
reqRepoReleaseWriter := context.RequireRepoWriter(unit.TypeReleases) reqRepoReleaseWriter := context.RequireRepoWriter(unit.TypeReleases)
reqRepoReleaseReader := context.RequireRepoReader(unit.TypeReleases) reqRepoReleaseReader := context.RequireRepoReader(unit.TypeReleases)
reqRepoWikiWriter := context.RequireRepoWriter(unit.TypeWiki) reqRepoWikiWriter := context.RequireRepoWriter(unit.TypeWiki)
reqRepoIssueWriter := context.RequireRepoWriter(unit.TypeIssues)
reqRepoIssueReader := context.RequireRepoReader(unit.TypeIssues) reqRepoIssueReader := context.RequireRepoReader(unit.TypeIssues)
reqRepoPullsReader := context.RequireRepoReader(unit.TypePullRequests) reqRepoPullsReader := context.RequireRepoReader(unit.TypePullRequests)
reqRepoIssuesOrPullsWriter := context.RequireRepoWriterOr(unit.TypeIssues, unit.TypePullRequests) reqRepoIssuesOrPullsWriter := context.RequireRepoWriterOr(unit.TypeIssues, unit.TypePullRequests)
@ -893,8 +892,8 @@ func RegisterRoutes(m *web.Route) {
}) })
}) })
m.Post("/reactions/{action}", bindIgnErr(forms.ReactionForm{}), repo.ChangeIssueReaction) m.Post("/reactions/{action}", bindIgnErr(forms.ReactionForm{}), repo.ChangeIssueReaction)
m.Post("/lock", reqRepoIssueWriter, bindIgnErr(forms.IssueLockForm{}), repo.LockIssue) m.Post("/lock", reqRepoIssuesOrPullsWriter, bindIgnErr(forms.IssueLockForm{}), repo.LockIssue)
m.Post("/unlock", reqRepoIssueWriter, repo.UnlockIssue) m.Post("/unlock", reqRepoIssuesOrPullsWriter, repo.UnlockIssue)
m.Post("/delete", reqRepoAdmin, repo.DeleteIssue) m.Post("/delete", reqRepoAdmin, repo.DeleteIssue)
}, context.RepoMustNotBeArchived()) }, context.RepoMustNotBeArchived())
m.Group("/{index}", func() { m.Group("/{index}", func() {