95f0fc0b7a
* every user has a right of a username and a display name and has the right to change it * System information page now shows information about database user count, char count, and database schema version * more maintenance lists * show the right values in columns and fields * move similar from inside of frontend component functions to utility js when used multiple times * display help on mouse over * add more than one believe to character * make char name editable with better char info in headline * GiT Gifttoleranz value not calculated correctly * Bump backend to 0.2.3, frontend to 0.2.2
30 lines
771 B
Go
30 lines
771 B
Go
package user
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// RegisterRoutes registers user-related routes
|
|
func RegisterRoutes(r *gin.RouterGroup) {
|
|
userGroup := r.Group("/user")
|
|
{
|
|
// Protected routes - require authentication
|
|
userGroup.GET("/profile", GetUserProfile)
|
|
userGroup.PUT("/display-name", UpdateDisplayName)
|
|
userGroup.PUT("/email", UpdateEmail)
|
|
userGroup.PUT("/password", UpdatePassword)
|
|
userGroup.PUT("/language", UpdateLanguage)
|
|
}
|
|
|
|
// Admin routes - require admin role
|
|
adminGroup := r.Group("/users")
|
|
adminGroup.Use(RequireAdmin())
|
|
{
|
|
adminGroup.GET("", ListUsers)
|
|
adminGroup.GET("/:id", GetUser)
|
|
adminGroup.PUT("/:id/role", UpdateUserRole)
|
|
adminGroup.PUT("/:id/password", ChangeUserPassword)
|
|
adminGroup.DELETE("/:id", DeleteUser)
|
|
}
|
|
}
|