|
@ -320,6 +320,7 @@ func (identity *Identity) canDo(action Action, bucket string, objectKey string) |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
target := string(action) + ":" + bucket + objectKey |
|
|
target := string(action) + ":" + bucket + objectKey |
|
|
|
|
|
adminTarget := s3_constants.ACTION_ADMIN + ":" + bucket + objectKey |
|
|
limitedByBucket := string(action) + ":" + bucket |
|
|
limitedByBucket := string(action) + ":" + bucket |
|
|
adminLimitedByBucket := s3_constants.ACTION_ADMIN + ":" + bucket |
|
|
adminLimitedByBucket := s3_constants.ACTION_ADMIN + ":" + bucket |
|
|
for _, a := range identity.Actions { |
|
|
for _, a := range identity.Actions { |
|
@ -328,6 +329,9 @@ func (identity *Identity) canDo(action Action, bucket string, objectKey string) |
|
|
if strings.HasPrefix(target, act[:len(act)-1]) { |
|
|
if strings.HasPrefix(target, act[:len(act)-1]) { |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
|
|
|
if strings.HasPrefix(adminTarget, act[:len(act)-1]) { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if act == limitedByBucket { |
|
|
if act == limitedByBucket { |
|
|
return true |
|
|
return true |
|
|