From c5ebb996019345316dbadbeca261bbbe769926b9 Mon Sep 17 00:00:00 2001 From: Nils Bandener <33570290+nibix@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:58:12 +0200 Subject: [PATCH] Fixed READ_ACTIONS required by TermsAggregationEvaluator (#4582) Signed-off-by: Nils Bandener --- .../privileges/TermsAggregationEvaluator.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/opensearch/security/privileges/TermsAggregationEvaluator.java b/src/main/java/org/opensearch/security/privileges/TermsAggregationEvaluator.java index d06a45726a..cc0bf25b5e 100644 --- a/src/main/java/org/opensearch/security/privileges/TermsAggregationEvaluator.java +++ b/src/main/java/org/opensearch/security/privileges/TermsAggregationEvaluator.java @@ -32,6 +32,11 @@ import org.apache.logging.log4j.Logger; import org.opensearch.action.ActionRequest; +import org.opensearch.action.fieldcaps.FieldCapabilitiesAction; +import org.opensearch.action.get.GetAction; +import org.opensearch.action.get.MultiGetAction; +import org.opensearch.action.search.MultiSearchAction; +import org.opensearch.action.search.SearchAction; import org.opensearch.action.search.SearchRequest; import org.opensearch.cluster.metadata.IndexNameExpressionResolver; import org.opensearch.cluster.service.ClusterService; @@ -49,13 +54,11 @@ public class TermsAggregationEvaluator { protected final Logger log = LogManager.getLogger(this.getClass()); private static final String[] READ_ACTIONS = new String[] { - "indices:data/read/msearch", - "indices:data/read/mget", - "indices:data/read/get", - "indices:data/read/search", - "indices:data/read/field_caps*" - // "indices:admin/mappings/fields/get*" - }; + MultiSearchAction.NAME, + MultiGetAction.NAME, + GetAction.NAME, + SearchAction.NAME, + FieldCapabilitiesAction.NAME }; private static final QueryBuilder NONE_QUERY = new MatchNoneQueryBuilder();