Add admin-route & dropdown-menu. Add clear-cache & create-code. Adjustments for activation-code and user models. Add sweet-alert for admin-tools.

This commit is contained in:
MaxJa4
2024-01-20 16:47:22 +01:00
parent f2ab72ba1e
commit e5d13f2270
15 changed files with 281 additions and 55 deletions

View File

@@ -4,4 +4,13 @@ type User struct {
Username string `json:"username" gorm:"primary_key"`
Password string `json:"password"`
Enabled bool `json:"enabled" default:"1"`
UserRole Role `json:"user_role" default:"READER"`
}
type Role string
const (
AdminRole Role = "ADMIN"
AuthorRole Role = "AUTHOR"
ReaderRole Role = "READER"
)