Skip to content

Commit

Permalink
fix(ac): adjusted permission required by several api (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI authored Sep 3, 2024
1 parent 568cf74 commit 3bd90c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion internal/dashboard/router/v1/conn_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import (
"github.com/gin-gonic/gin"

acbiz "github.com/oceanbase/ob-operator/internal/dashboard/business/ac"
obbiz "github.com/oceanbase/ob-operator/internal/dashboard/business/oceanbase"
h "github.com/oceanbase/ob-operator/internal/dashboard/handler"
)

func InitTerminalRoutes(g *gin.RouterGroup) {
g.PUT("/obclusters/namespace/:namespace/name/:name/terminal", h.Wrap(h.CreateOBClusterConnTerminal, acbiz.PathGuard("obcluster", ":namespace+:name", "write")))
g.PUT("/obtenants/:namespace/:name/terminal", h.Wrap(h.CreateOBTenantConnTerminal, acbiz.PathGuard("obtenant", ":namespace+:name", "write")))
g.PUT("/obtenants/:namespace/:name/terminal", h.Wrap(h.CreateOBTenantConnTerminal, obbiz.TenantGuard(":namespace", ":name", "write")))
g.GET("/terminal/:terminalId", h.Wrap(h.ConnectDatabase))
}
4 changes: 2 additions & 2 deletions internal/dashboard/router/v1/metric_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ import (
)

func InitMetricRoutes(g *gin.RouterGroup) {
g.GET("/metrics", h.Wrap(h.ListMetricMetas, acbiz.PathGuard("system", "*", "read")))
g.POST("/metrics/query", h.Wrap(h.QueryMetrics, acbiz.PathGuard("system", "*", "read")))
g.GET("/metrics", h.Wrap(h.ListMetricMetas, acbiz.PathGuard("obcluster", "*", "read")))
g.POST("/metrics/query", h.Wrap(h.QueryMetrics, acbiz.PathGuard("obcluster", "*", "read")))
}

0 comments on commit 3bd90c7

Please sign in to comment.