3
0

Restructure protected routes in compose & federation

This commit is contained in:
Denis Arh
2020-12-19 08:24:32 +01:00
parent 5b960a0136
commit 8c31bf1b86
3 changed files with 24 additions and 23 deletions

View File

@@ -28,15 +28,17 @@ func MountRoutes(r chi.Router) {
// Protect all _private_ routes
r.Group(func(r chi.Router) {
r.Use(auth.MiddlewareValidOnly)
r.Use(middlewareAllowedAccess)
handlers.NewNamespace(namespace).MountRoutes(r)
handlers.NewPage(page).MountRoutes(r)
handlers.NewAutomation(automation).MountRoutes(r)
handlers.NewModule(module).MountRoutes(r)
handlers.NewRecord(record).MountRoutes(r)
handlers.NewChart(chart).MountRoutes(r)
handlers.NewNotification(notification).MountRoutes(r)
handlers.NewPermissions(Permissions{}.New()).MountRoutes(r)
r.Group(func(r chi.Router) {
r.Use(middlewareAllowedAccess)
handlers.NewNamespace(namespace).MountRoutes(r)
handlers.NewPage(page).MountRoutes(r)
handlers.NewAutomation(automation).MountRoutes(r)
handlers.NewModule(module).MountRoutes(r)
handlers.NewRecord(record).MountRoutes(r)
handlers.NewChart(chart).MountRoutes(r)
handlers.NewNotification(notification).MountRoutes(r)
})
})
}