ADD: team site and player/usermanagement is working

This commit is contained in:
hwinkel
2025-11-22 14:51:53 +01:00
parent 846a922a41
commit 139a99d96e
13 changed files with 229 additions and 111 deletions

View File

@@ -100,13 +100,15 @@ func GetPlayer(c *gin.Context, db *sql.DB, id string) {
}
func UpdatePlayer(c *gin.Context, db *sql.DB) {
log.Println(c)
playerID := c.Param("id")
if playerID == "" {
common.RespondError(c, http.StatusBadRequest, "Player ID is required")
return
}
if playerID != c.GetString("userId") || c.GetString("role") != "admin" {
log.Println("role: ", c.GetString("role"))
// playerID != c.GetString("userId") ||
if c.GetString("role") != "admin" {
common.RespondError(c, http.StatusForbidden, "You do not have permission to update this player")
return
}