mirror of https://github.com/minio/minio.git
fix: do not return an error on expired credentials (#12057)
policy might have an associated mapping with an expired user key, do not return an error during DeletePolicy for such situations - proceed normally as its an expected situation.
This commit is contained in:
parent
885c170a64
commit
39dd9b6483
|
@ -672,8 +672,10 @@ func (sys *IAMSys) DeletePolicy(policyName string) error {
|
|||
if pset.Contains(policyName) {
|
||||
cr, ok := sys.iamUsersMap[u]
|
||||
if !ok {
|
||||
// This case cannot happen
|
||||
return errNoSuchUser
|
||||
// This case can happen when an temporary account
|
||||
// is deleted or expired, removed it from userPolicyMap.
|
||||
delete(sys.iamUserPolicyMap, u)
|
||||
continue
|
||||
}
|
||||
pset.Remove(policyName)
|
||||
// User is from STS if the cred are temporary
|
||||
|
|
Loading…
Reference in New Issue