mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
fix: allow gateway to work with root credentials (#12655)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user