Selaa lähdekoodia

Merge pull request #7479 from heyitsanthony/auth-admin-nilcheck

auth: nil check AuthInfo when checking admin permissions
Xiang Li 8 vuotta sitten
vanhempi
commit
76aa7f6935
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      auth/store.go

+ 3 - 0
auth/store.go

@@ -744,6 +744,9 @@ func (as *authStore) IsAdminPermitted(authInfo *AuthInfo) error {
 	if !as.isAuthEnabled() {
 		return nil
 	}
+	if authInfo == nil {
+		return ErrUserEmpty
+	}
 
 	tx := as.be.BatchTx()
 	tx.Lock()