Added admin type user
This commit is contained in:
parent
6c1ecf55f9
commit
dbc3886706
|
@ -61,6 +61,8 @@ func SetEngine() (err error) {
|
|||
|
||||
// If it doesn't exist, create it
|
||||
if !exists {
|
||||
Config.FirstUser.IsAdmin = true // Make the first user admin
|
||||
|
||||
_, err = CreateUser(Config.FirstUser)
|
||||
if err != nil {
|
||||
// Janky hack, I know
|
||||
|
|
|
@ -20,6 +20,7 @@ type User struct {
|
|||
Username string `xorm:"varchar(250) not null unique"`
|
||||
Password string `xorm:"varchar(250) not null"`
|
||||
Email string `xorm:"varchar(250)"`
|
||||
IsAdmin bool `xorm:"tinyint(1) not null"`
|
||||
Created int64 `xorm:"created"`
|
||||
Updated int64 `xorm:"updated"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue