Added admin type user

This commit is contained in:
konrad 2018-01-23 11:20:22 +01:00 committed by kolaente
parent 6c1ecf55f9
commit dbc3886706
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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"`
}