diff --git a/cmd/admin-handlers-users.go b/cmd/admin-handlers-users.go index 48832bdf8..97a6b61f4 100644 --- a/cmd/admin-handlers-users.go +++ b/cmd/admin-handlers-users.go @@ -1019,11 +1019,15 @@ func (a adminAPIHandlers) AccountInfoHandler(w http.ResponseWriter, r *http.Requ return rd, wr } - // Load the latest calculated data usage - dataUsageInfo, err := loadDataUsageFromBackend(ctx, objectAPI) - if err != nil { - // log the error, continue with the accounting response - logger.LogIf(ctx, err) + var dataUsageInfo madmin.DataUsageInfo + var err error + if !globalIsGateway { + // Load the latest calculated data usage + dataUsageInfo, err = loadDataUsageFromBackend(ctx, objectAPI) + if err != nil { + // log the error, continue with the accounting response + logger.LogIf(ctx, err) + } } // If etcd, dns federation configured list buckets from etcd. diff --git a/cmd/signature-v4-utils.go b/cmd/signature-v4-utils.go index 7647376f0..c2f749f56 100644 --- a/cmd/signature-v4-utils.go +++ b/cmd/signature-v4-utils.go @@ -131,11 +131,12 @@ func checkKeyValid(accessKey string) (auth.Credentials, bool, APIErrorCode) { var cred = globalActiveCred if cred.AccessKey != accessKey { // Check if the access key is part of users credentials. - var ok bool - if cred, ok = globalIAMSys.GetUser(accessKey); !ok { + ucred, ok := globalIAMSys.GetUser(accessKey) + if !ok { return cred, false, ErrInvalidAccessKeyID } - owner = false + owner = cred.AccessKey == ucred.ParentUser + cred = ucred } return cred, owner, ErrNone }