From eb44965cd04fc0fb2d5a8ace0f058d4c77c4f3e7 Mon Sep 17 00:00:00 2001 From: Gaius Date: Wed, 23 Mar 2022 15:41:21 +0800 Subject: [PATCH] feat: add RBAC to manager config interface (#1179) Signed-off-by: Gaius --- manager/router/router.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/router/router.go b/manager/router/router.go index 30de995b0..c267b2f24 100644 --- a/manager/router/router.go +++ b/manager/router/router.go @@ -197,10 +197,10 @@ func Init(cfg *config.Config, logDir string, service service.Service, enforcer * // Config config := apiv1.Group("/configs") - config.POST("", h.CreateConfig) - config.DELETE(":id", h.DestroyConfig) - config.PATCH(":id", h.UpdateConfig) - config.GET(":id", h.GetConfig) + config.POST("", h.CreateConfig, jwt.MiddlewareFunc(), rbac) + config.DELETE(":id", h.DestroyConfig, jwt.MiddlewareFunc(), rbac) + config.PATCH(":id", h.UpdateConfig, jwt.MiddlewareFunc(), rbac) + config.GET(":id", h.GetConfig, jwt.MiddlewareFunc(), rbac) config.GET("", h.GetConfigs) // Job