mirror of
https://github.com/minio/minio.git
synced 2025-04-19 10:07:30 -04:00
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) {
|
if pset.Contains(policyName) {
|
||||||
cr, ok := sys.iamUsersMap[u]
|
cr, ok := sys.iamUsersMap[u]
|
||||||
if !ok {
|
if !ok {
|
||||||
// This case cannot happen
|
// This case can happen when an temporary account
|
||||||
return errNoSuchUser
|
// is deleted or expired, removed it from userPolicyMap.
|
||||||
|
delete(sys.iamUserPolicyMap, u)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
pset.Remove(policyName)
|
pset.Remove(policyName)
|
||||||
// User is from STS if the cred are temporary
|
// User is from STS if the cred are temporary
|
||||||
|
Loading…
x
Reference in New Issue
Block a user