fixed con stuff

This commit is contained in:
2024-05-23 23:23:03 +03:00
parent 6e1f50cac3
commit 2824968dc3
3 changed files with 19 additions and 17 deletions

View File

@@ -146,6 +146,7 @@ func LoadBrowsersGroup(group *gin.RouterGroup, mongo_client *mongo.Client, confi
defer apiClient.Close()
connection := Connection{databaseConnection: mongo_client, dockerClient: apiClient}
authConnection := auth.Connection{DatabaseConnection: mongo_client}
group.GET("/", auth.AuthorizedTo(0), connection.GetBrowsers)
group.POST("/:server_id/stop", auth.AuthorizedTo(models.Browse, connection.serverAuthorized(models.Browse)), connection.StopBrowser)
group.POST("/:server_id/stop", auth.AuthorizedTo(models.Browse, authConnection.ServerAuthorized(models.Browse)), connection.StopBrowser)
}