Fix misplaced if

This commit is contained in:
Howl 2016-06-16 13:14:19 +02:00
parent 06eb64ecf5
commit cbcfacb06a

View File

@ -18,10 +18,10 @@ func GetTokenFull(token string, db *sql.DB) (common.Token, bool) {
Scan( Scan(
&t.ID, &t.UserID, &privs, &priv8, &t.ID, &t.UserID, &privs, &priv8,
) )
t.Privileges = common.Privileges(privs)
if priv8 { if priv8 {
privs = common.PrivilegeRead | common.PrivilegeReadConfidential | common.PrivilegeWrite privs = common.PrivilegeRead | common.PrivilegeReadConfidential | common.PrivilegeWrite
} }
t.Privileges = common.Privileges(privs)
switch { switch {
case err == sql.ErrNoRows: case err == sql.ErrNoRows:
return common.Token{}, false return common.Token{}, false