3
0

Fix nasty little bug with user-autopromotion

This commit is contained in:
Denis Arh
2019-07-09 17:59:11 +02:00
parent acffdc1c65
commit dd66f0398b
+1 -1
View File
@@ -815,7 +815,7 @@ func (svc auth) createUserToken(user *types.User, kind string) (token string, er
// Automatically promotes user to administrator if it is the first user in the database
func (svc auth) autoPromote(u *types.User) (err error) {
if svc.users.Total() == 0 && u.ID > 0 {
if svc.users.Total() == 1 && u.ID > 0 {
err = svc.roles.MemberAddByID(permissions.AdminRoleID, u.ID)
svc.log(