mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 12:40:24 +03:00
api: Add new bucket policy nesting error (#1883)
* Added ErrPolicyNesting which is returned when nesting of policies has occured * Replaces ErrMalformedPolicy in the case of nesting * Changed test case in bucket-policy-parser_test.go (ErrMalformedPolicy -> ErrPolicyNesting)
This commit is contained in:
committed by
Harshavardhana
parent
f2765d98a8
commit
6f3bd76754
@@ -255,7 +255,7 @@ func checkBucketPolicyResources(bucket string, bucketPolicy BucketPolicy) APIErr
|
||||
for _, otherResource := range resources {
|
||||
// Common prefix reject such rules.
|
||||
if strings.HasPrefix(otherResource, resource) {
|
||||
return ErrMalformedPolicy
|
||||
return ErrPolicyNesting
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user