aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-13 03:59:28 +0800
committerGitHub <noreply@github.com>2022-12-12 20:59:28 +0100
commita8534ac4a4ff5d27479ed1f1d079d8fa54986711 (patch)
tree0e2b59f59d370bd263aa76779a55d8d520f917c9
parente23ad87b550f2a6b4250a7e99f04fec16532c347 (diff)
downloadgitea-a8534ac4a4ff5d27479ed1f1d079d8fa54986711.tar.gz
gitea-a8534ac4a4ff5d27479ed1f1d079d8fa54986711.zip
Fix permission check on issue/pull lock (#22114)
Fix #22110
-rw-r--r--routers/web/web.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index e4fea38244..3bcbc6d7c0 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -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)
@@ -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() {