Files
compute-engine/router/authz-router.go
T

20 lines
571 B
Go
Raw Normal View History

package router
import (
"github.com/QuantumNous/new-api/controller"
"github.com/QuantumNous/new-api/middleware"
"github.com/gin-gonic/gin"
)
// registerAuthzRoutes mounts the authorization API under its own /authz
// namespace. GET /authz/catalog returns the permission schema (resources,
// actions, and role baselines) used by the client permission editor.
func registerAuthzRoutes(apiRouter *gin.RouterGroup) {
authzRoute := apiRouter.Group("/authz")
authzRoute.Use(middleware.AdminAuth())
{
authzRoute.GET("/catalog", controller.GetPermissionCatalog)
}
}