summaryrefslogtreecommitdiffstats
path: root/routers/api/packages/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/packages/api.go')
-rw-r--r--routers/api/packages/api.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/routers/api/packages/api.go b/routers/api/packages/api.go
index 4b274860dc..84bdce30fa 100644
--- a/routers/api/packages/api.go
+++ b/routers/api/packages/api.go
@@ -156,12 +156,15 @@ func Routes() *web.Route {
})
})
r.Group("/generic", func() {
- r.Group("/{packagename}/{packageversion}/{filename}", func() {
- r.Get("", generic.DownloadPackageFile)
- r.Group("", func() {
- r.Put("", generic.UploadPackage)
- r.Delete("", generic.DeletePackage)
- }, reqPackageAccess(perm.AccessModeWrite))
+ r.Group("/{packagename}/{packageversion}", func() {
+ r.Delete("", reqPackageAccess(perm.AccessModeWrite), generic.DeletePackage)
+ r.Group("/{filename}", func() {
+ r.Get("", generic.DownloadPackageFile)
+ r.Group("", func() {
+ r.Put("", generic.UploadPackage)
+ r.Delete("", generic.DeletePackageFile)
+ }, reqPackageAccess(perm.AccessModeWrite))
+ })
})
})
r.Group("/helm", func() {