policy: Fix a typo when validating the list of policies (#13735)

When assigning two policies to a user using mc command, the server code
wrongly validates due to a typo in the code, the commit fixes it.
This commit is contained in:
Anis Elleuch 2021-11-23 17:57:29 +01:00 committed by GitHub
parent 3b5d6f003f
commit d1bfb4d2c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -805,7 +805,7 @@ func (store *IAMStoreSys) PolicyDBSet(ctx context.Context, name, policy string,
// Handle policy mapping set/update
mp := newMappedPolicy(policy)
for _, p := range mp.toSlice() {
if _, found := cache.iamPolicyDocsMap[policy]; !found {
if _, found := cache.iamPolicyDocsMap[p]; !found {
logger.LogIf(GlobalContext, fmt.Errorf("%w: (%s)", errNoSuchPolicy, p))
return errNoSuchPolicy
}