feat(api): permission

This commit is contained in:
ttk
2024-09-23 18:02:14 +08:00
parent 03eec7abbc
commit 78199b7ba6
20 changed files with 494 additions and 143 deletions

View File

@@ -131,13 +131,13 @@ func RunApi() error {
share := v1.Group("/share")
{
share.POST("", authAdmin(), c.CreateShare)
share.DELETE("/:id", authAdmin(), c.DeleteShare)
share.GET("", authAdmin(), c.GetShare)
share.POST("", c.CreateShare)
share.DELETE("/:id", c.DeleteShare)
share.GET("", c.GetShare)
}
r.GET("/api/oneterm/v1/share/connect/:uuid", Error2Resp(), c.ConnectShare)
authorization := v1.Group("/authorization", authAdmin())
authorization := v1.Group("/authorization")
{
authorization.POST("", c.UpsertAuthorization)
authorization.DELETE("/:id", c.DeleteAccount)