mirror of
https://github.com/minio/minio.git
synced 2025-11-25 12:06:10 -05:00
Disallow only policy statements which are exactly same (#8785)
This commit is contained in:
@@ -110,13 +110,11 @@ func (iamp Policy) isValid() error {
|
||||
continue
|
||||
}
|
||||
|
||||
actions := iamp.Statements[i].Actions.Intersection(statement.Actions)
|
||||
if len(actions) == 0 {
|
||||
if !iamp.Statements[i].Actions.Equals(statement.Actions) {
|
||||
continue
|
||||
}
|
||||
|
||||
resources := iamp.Statements[i].Resources.Intersection(statement.Resources)
|
||||
if len(resources) == 0 {
|
||||
if !iamp.Statements[i].Resources.Equals(statement.Resources) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -125,7 +123,7 @@ func (iamp Policy) isValid() error {
|
||||
}
|
||||
|
||||
return Errorf("duplicate actions %v, resources %v found in statements %v, %v",
|
||||
actions, resources, iamp.Statements[i], statement)
|
||||
statement.Actions, statement.Resources, iamp.Statements[i], statement)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user