1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-02 09:25:48 +00:00

Fix issue pasted image missing if no release permission (#16520) (#16527)

* Fix issue pasted image missing if no release permission


Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Lunny Xiao 2021-07-25 00:34:57 +08:00 committed by GitHub
parent 67942ac1a9
commit 89f680aa04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -822,9 +822,14 @@ func RegisterRoutes(m *web.Route) {
}
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
})
m.Get("/attachments/{uuid}", repo.GetAttachment)
}, ignSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoReleaseReader)
// to maintain compatibility with old attachments
m.Group("/{username}/{reponame}", func() {
m.Get("/attachments/{uuid}", repo.GetAttachment)
}, ignSignIn, context.RepoAssignment, context.UnitTypes())
m.Group("/{username}/{reponame}", func() {
m.Post("/topics", repo.TopicsPost)
}, context.RepoAssignment, context.RepoMustNotBeArchived(), reqRepoAdmin)