summaryrefslogtreecommitdiff
path: root/app/controllers/sparkles
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/sparkles')
-rw-r--r--app/controllers/sparkles/controller.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/sparkles/controller.go b/app/controllers/sparkles/controller.go
index cd86cd2..bd7264e 100644
--- a/app/controllers/sparkles/controller.go
+++ b/app/controllers/sparkles/controller.go
@@ -21,10 +21,12 @@ func New(db domain.Repository[*domain.Sparkle]) *Controller {
}
func (c *Controller) MountTo(mux *http.ServeMux) {
- requireUser := middleware.RequireUser()
-
mux.HandleFunc("GET /sparkles", c.Index)
- mux.Handle("POST /sparkles", requireUser(http.HandlerFunc(c.Create)))
+ mux.Handle("POST /sparkles", x.Middleware[http.Handler](
+ http.HandlerFunc(c.Create),
+ middleware.RequireUser(),
+ // middleware.RequirePermission("create_sparkle", nil),
+ ))
// This is a temporary endpoint to restore a backup
mux.HandleFunc("POST /sparkles/restore", c.Restore)