aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-12 23:02:51 +0800
committerGitHub <noreply@github.com>2022-12-12 23:02:51 +0800
commit87c64f655a6085f23499156504e039c13da77b21 (patch)
tree287de5d7e72ddec597704ef53fac7e7712c582c4
parent36a2d2f919ee445f0374c210309b336e7c3c1f8e (diff)
downloadgitea-87c64f655a6085f23499156504e039c13da77b21.tar.gz
gitea-87c64f655a6085f23499156504e039c13da77b21.zip
Fix permission check on issue/pull lock (#22110)
Fix #21826
-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 99c2a83917..f9d97758a1 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -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)
@@ -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() {