Skip to content

Commit a2ea6f2

Browse files
committed
Skip pointless map
1 parent 2ccbcdf commit a2ea6f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ public IndicesAccessControl authorize(
565565
totalResourceCount += resource.size(lookup);
566566
}
567567

568-
final boolean overallGranted = isActionGranted(action, resources);
568+
final boolean overallGranted = isActionGranted(action, resources.values());
569569
final int finalTotalResourceCount = totalResourceCount;
570570
final Supplier<Map<String, IndicesAccessControl.IndexAccessControl>> indexPermissions = () -> buildIndicesAccessControl(
571571
action,
@@ -695,11 +695,11 @@ && containsPrivilegeThatGrantsMappingUpdatesForBwc(group))) {
695695
* Returns {@code true} if action is granted for all {@code requestedResources}.
696696
* If action is not granted for at least one resource, this method will return {@code false}.
697697
*/
698-
private boolean isActionGranted(final String action, final Map<String, IndexResource> requestedResources) {
698+
private boolean isActionGranted(final String action, final Collection<IndexResource> requestedResources) {
699699

700700
final boolean isMappingUpdateAction = isMappingUpdateAction(action);
701701

702-
for (IndexResource resource : requestedResources.values()) {
702+
for (IndexResource resource : requestedResources) {
703703
// true if ANY group covers the given index AND the given action
704704
boolean granted = false;
705705
// true if ANY group, which contains certain ingest privileges, covers the given index AND the action is a mapping update for

0 commit comments

Comments
 (0)