17 lines
337 B
Go
17 lines
337 B
Go
package models
|
|
|
|
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"
|
|
)
|